-
Notifications
You must be signed in to change notification settings - Fork 353
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 to ^2.6.0 #2278
Conversation
This brings manager and docs up to the latest version of webpack 2.6 release. It will allow for future improvements that are only available in webpack 2+. Changes include: - Updated syntax for webpack loaders. [link](https://webpack.js.org/guides/migrating/#module-loaders-is-now-module-rules) - Use the babel-plugin-istanbul to instrument code for tests, as per recommendation by the webpack-contrib team. [link](webpack-contrib/istanbul-instrumenter-loader#44 (comment)) - Use `cross-env` for all npm scripts to improve compatibility.
What is cross-env? |
@@ -26,7 +28,6 @@ _.plugins = [ | |||
warnings: false | |||
} | |||
}), | |||
new webpack.optimize.DedupePlugin(), | |||
new webpack.optimize.AggressiveMergingPlugin() |
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.
Numbers on new bundle size plz?
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.
manager | size (Bytes) |
---|---|
this branch with webpack 2 | 1,979,664 |
current develop branch | 1,900,556 |
+79,108 |
docs | size (Bytes) |
---|---|
this branch with webpack 2 | 1,593,314 |
current develop branch | 1,524,985 |
+68,329 |
The reason for removing it is here:
https://webpack.js.org/guides/migrating/#dedupeplugin-has-been-removed
I'll get some more references for changes in webpack2 that can be used to decrease the bundle size.
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.
Linking to some tests that I ran. It includes a test using the recommended babel config for webpack2. It ends up being slightly smaller/equal to the current bundle after the change.
https://gist.github.com/stvnjacobs/9daa815d3a2cc179eb2604f93066a76b
I know this is a task and all :p but could you (or @mparke) include a sentence or two on why this is useful/needed? |
@stvnjacobs yeah I'm not asking why you added it. I'm curious what it does |
Is any of this going to conflict with our plans to get into newer npm versions? I.e. is it better they be done together or not so much? |
@eatonphil in regards to
I didn't look under the hood, just followed what was used for
I'll try and write something up. |
This should not create any conflicts I had previously looked to do them together, but should be do-able in chunks, getting to webpack-2 should allow us to resolve symlinks in npm5 for local package paths ( i.e. also see https://webpack.js.org/configuration/resolve/#resolve-symlinks and http://blog.npmjs.org/post/161081169345/v500 |
Same question, actually, and can we open a separate PR for it if possible? |
|
In addition to what @mparke has mentioned regarding symlinks, the main differentiator between Webpack 1 and 2 is that it now supports parsing ES2015 style module imports[1], rather than relying on Babel to convert them to CommonJS style. The benefit of this is that Webpack can more accurately parse the entire codebase, resulting in improvements to transformations and optimizations (one example being tree shaking[2][3]). [1] https://auth0.com/blog/javascript-module-systems-showdown/ Note: Babel, in our current configuration, normalizes all imports to CommonJS style before passing on to Webpack. By adding |
Can you just set modules false here? I did that and didn't seem to be getting much of an improvement in size. But we might as well anyway. |
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.
tested manager and docs looks good
can we wait for any other changes until after merge @eatonphil |
lgtm for now. Let's get the size down though. Thanks @stvnjacobs |
This brings manager and docs up to the latest version of webpack 2.6
release. It will allow for future improvements that are only available
in webpack 2+.
Changes include:
babel-plugin-istanbul
to instrument code for tests,as per recommendation by the webpack-contrib team. link
Usecross-env
for all npm scripts to improve compatibility.This addresses #2211