-
-
Notifications
You must be signed in to change notification settings - Fork 26.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
0.10 prerelease with webpack 2 increases bundle size #1843
Comments
Part of the reason is because of webpack/webpack#4493. I'm not sure why the existing build is growing so much ... probably the same reason (I'd hope). Can you look at this with source-map-explorer as explained in #1641? Unfortunately we cannot leverage tree-shaking yet (and are using babel to compile to commonjs) because sourcemaps are broken (webpack/webpack#4423), and tree-shaking actually doesn't work at all (webpack/webpack#2867, webpack/webpack#2899, webpack/webpack#3092). |
Interesting... I wonder if webpack 1 vs 2 have different versions of uglify and there was a regression on that front... Unless if we regressed in our configuration. |
Maybe the default configuration changed, can you try some of the options in #1644? You can edit the config file in your |
I'd be surprised if it was Uglify. I suspect some polyfill we happen to bundle (e.g. process) got larger, something changed at module boundaries, or some pattern got harder to uglify (e.g. something that used to repeat in Webpack 1 is now unique every time defeating compression in Webpack 2). Need to look at minimal bundles from both. Also at minimal bundles without React for both. |
I don't know if it's useful but I marked up a few of the differences on 0.10.0. lodash appears to be included twice (two large purple boxes), I'm not certain what's going on there. Generally all parts in 0.10.0 are smaller by up to a couple of kb but there were some exceptions (significant decrease (green), no change (blue), increase(red)) and some name changes from |
@AJamesPhillips how is this log printed? seems great. |
@watert I just took the screen shots from gavinwahl's posts above. He might have followed the instructions Timer link to in his comment. |
Closing this as unactionable by us; webpack updated its node stubs which are now larger -- we've actually removed some of these stubs by default now so your bundle might have shrunk. Feel free to open a new issue if someone has something compelling. |
On a newly created empty project and react-scripts@0.9.5, I get these bundle sizes for the production build after running
yarn run build
:After upgrading to the 0.10.0 alpha (328cb32), I get:
I expect the bundle size not to increase after upgrading. In my production project, I get an even larger increase:
The text was updated successfully, but these errors were encountered: