I’m new to webpack, and many info about this issue is on browserify. I switched to webpack and had the same issue.
The thing is – I don’t really know is this issue at all or not? Is it ok to have 800kb js file for using node module loader system?
5 thoughts on “Webpack with react and lodash makes bundle.js more than 800kb”
Comments are closed.
Another idea would be to explicitly require the bits you want from lodash:
Also you can make react much smaller by doing a production build:
For React, it’s a good idea to use React NPM module and have
in
plugins
in production config.(Edit: nevermind, I just noticed @nelix already said that)
@gaearon a quick question: is the JSON.stringify really needed for
'NODE_ENV': JSON.stringify('production')
??@binarykitchen
You want the quotes to be there.
i.e. it should be
and not
or it’ll refer to undefined
production
variable.JSON.stringify
it just to make it clear.Use
-p
key (shortcut for--optimize-minimize
):