peter-mouland / react-lego

React-lego : incrementally add more cool stuff to your react app
http://react-lego.herokuapp.com/
MIT License
414 stars 36 forks source link

Fix uglify in production config. #37

Closed leMaik closed 8 years ago

leMaik commented 8 years ago

concat creates a new array, which was not used previously, resulting in UglifyJS not being enabled in production.

In my project, I use webpack-isomorphic-tools, so not modifying the common configuration object but creating a new instance is required, so I prefer this approach instead of manipulating the array with push.

peter-mouland commented 8 years ago

great, can't believe i missed that. thanks!

at least this is a problem that goes away with webpack2's -p flag :)

leMaik commented 8 years ago

@peter-mouland This fix should probably be merged/rebased into the other branches. :) What does -p do? Enable all production-only plugins that are disabled by default?

peter-mouland commented 8 years ago

yeah, i'll get round to adding - updating the other branches takes a moment though to go through them all!

-p is exactly as you say. in webpack v2 to you get uglify for free, and -p turns it on. i'm sure it does others too.

leMaik commented 8 years ago

Sounds great! Any ETA on webpack 2 support in react-lego?

peter-mouland commented 8 years ago

there are already branches there 👍 https://github.com/peter-mouland/react-lego/tree/express--webpack-v2

https://github.com/peter-mouland/react-lego/commit/0d5d8e53f844ab67802c59ff0f7c7869304a99bc

peter-mouland commented 8 years ago

All other branches have now been updated - including the webpack 2 branch, so the code comparisons should be easy to view now.

thanks again