Fix various Karma + webpack warnings and minor issues #641
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes a few follow-up fixes to Karma + webpack
Fix Karma webpack output to prevent overwriting
dist/
Previously
npm run karma
used webpack to overwritedist/
but usingkarma-webpack
defaults instead. This has now been fixed so that Karma output is written toos.tmpdir()
as the author intendedFix Karma webpack
karma-sourcemap-loader
warningsKarma webpack
devtool
option now outputs inline source maps to fix warnings about missing source mapsEnsure webpack uses new
serve
CLI commandWe can now use the webpack CLI rather than the
webpack-dev-server
package binary:Ensure webpack always exits on build errors
The webpack
NoEmitOnErrorsPlugin
plugin is now enabled by default but we turn it off in development mode to help diagnose problems in the browser rather than exitWarnings since webpack v5 update
Additionally, new warnings have been fixed following the webpack v5 update:
Fix Karma webpack performance warnings
The Karma webpack
stats: 'errors-only'
option has been updated for webpack v5 to ignore performance warning recommendations since these are only useful for production buildsFix Karma webpack
DefinePlugin
warning forNODE_ENV
The Karma webpack build runs with
NODE_ENV=test
but this logs a warning in webpack v5 because “test” does not match webpackconfig.mode
allowed values"none" | "development" | "production"