react-dom blowing out webpack bundle size MASSIVELY react-dom blowing out webpack bundle size MASSIVELY reactjs reactjs

react-dom blowing out webpack bundle size MASSIVELY


http://elijahmanor.com/react-file-size/

In v15.4.0 the file size of react-dom grew from 1.17kB to 619.05kB. Which means my webpack setup isn't doing anything wrong bundling files. The reason why this module grew so large is because code was transferred from the react module.


If you look into the corresponding folders under the node_modules folder, and note the file sizes, you'll see that there's nothing to be surprised about:

react

react-dom

That is, the size of the bundle grows noticeably because the size of react-dom.js is large.


I had to change my webpack.config.js, from

devtool: 'inline-source-map'

enter image description here

to

devtool: 'source-map'

enter image description here

Now it generates a much smaller .js + a separate .js.map file, for each of the chunks.

Notice the JS size is even less than react-dom.production.min.js in node_modules:enter image description here