-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
bundle size ~20% larger after upgrading to v2.x #4493
Comments
There's not enough information to say why. Is it possible for you to share stats for both builds? If not, can you set up a small project that shows the difference so that it can be studied in detail. |
The size of some node.js builtin polyfills increased, i. e. the crypto package is much larger... Are you using any other these? |
thanks for taking a look.
yep, give me a bit to round them up :)
not intentionally. is there a way to verify they are being included? if they are, how can i track down what caused them to be? |
lol, these things are huge even after stripping out the
given what i found digging thru my stats.json file, i'm thinking this is the underlying cause. can these polyfills be excluded? adding bottom-line: a bunch of dependencies are being included by default w/o being required by my code - specifically: bn.js, buffer, readable-stream, browserify-aes, hash.js, browserify-sign, parse-asn1, sha.js, asn1.js, public-encrypt, and likely a few more. on the whole, these dependencies appear to be webpack-only (iow, not dependencies of my code or of the dependencies my code uses). |
more investigation: if i replace my entry module w/
my bundle.js size is 311b 👍 if i edit that to be:
my bundle.js size is 95.5k 👎 😮 💡 😂
OR DOES IT??? lol, turns out a while back they renamed edit: i guess this can be closed up now. thanks for the pointers. |
Do you want to request a feature or report a bug?
bug. i think?
What is the current behavior?
after upgrading to webpack v2.2.1 from webpack v1.14.0 my gzipped bundle size is ~20% larger. i've read the related reports that i could find (1, 2) and didn't spot any config-related tweak that could be causing the difference. using webpack-bundle-analyzer and running in "production" mode (minified, no sourcemaps), i see the following:
before:
after:
Running in "development" mode (unminified + sourcemaps) mode i see:
before:
after:
my code is pretty simple - 100% CJS-style modules w/o any ES6 transpilation (yes, i know it's 2017 ;-), and a bunch of fairly well-know libs (react, immutable.js, bluebird, lodash, are the biggies).
If the current behavior is a bug, please provide the steps to reproduce.
my "production" webpack config:
What is the expected behavior?
production bundle generated by v2.2.1 is roughly the same size or smaller than the one generated by v1.14.0
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
macOS v10.12.3, node v6.9.1, webpack v2.2.1
The text was updated successfully, but these errors were encountered: