-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade webpack and related packages #392
Conversation
The total bundle size is made slightly smaller by this:
I suspect that a lot of vendors.bundle.js is unused code, but I won't change that in this PR. |
minChunks: function(module) { | ||
return module.context && module.context.indexOf('node_modules') !== -1; | ||
optimization: { | ||
splitChunks: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from https://webpack.js.org/plugins/split-chunks-plugin/#split-chunks-example-2 and I think it's equivalent to the original config.
The `mode` option needs to be added to webpack config: https://webpack.js.org/migrate/4#mode CommonsChunkPlugin is replaced by new config: https://webpack.js.org/migrate/4#commonschunkplugin https://webpack.js.org/configuration/optimization/#optimizationsplitchunks https://webpack.js.org/plugins/split-chunks-plugin/#split-chunks-example-2 CleanWebpackPlugin uses webpack's `output.path` by default, so use the default configuration: johnagan/clean-webpack-plugin#106 UglifyjsWebpackPlugin is replaced with TerserWebpackPlugin, which is now webpack's default minimizer: https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions webpack/webpack#8036 Unfortunately karma-webpack 4.0.0 isn't released yet, so a release candidate is used instead.
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
=======================================
Coverage 60.77% 60.77%
=======================================
Files 54 54
Lines 2904 2904
=======================================
Hits 1765 1765
Misses 1139 1139 Continue to review full report at Codecov.
|
Staging deployment: https://confluence-8acbeef-dot-web-confluence.appspot.com |
Tested manually, seems fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (not really familiar with Webpack though)
Neither am I, the commit message is all that I learned trying to fix this :) |
The
mode
option needs to be added to webpack config:https://webpack.js.org/migrate/4#mode
CommonsChunkPlugin is replaced by new config:
https://webpack.js.org/migrate/4#commonschunkplugin
https://webpack.js.org/configuration/optimization/#optimizationsplitchunks
CleanWebpackPlugin uses webpack's
output.path
by default, so use thedefault configuration:
johnagan/clean-webpack-plugin#106
UglifyjsWebpackPlugin is replaced with TerserWebpackPlugin, which is
now webpack's default minimizer:
https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions
webpack/webpack#8036
Unfortunately karma-webpack 4.0.0 isn't released yet, so a release
candidate is used instead.