Skip to content
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

Production build specific plugins #24

Open
steverob opened this issue Aug 15, 2017 · 2 comments
Open

Production build specific plugins #24

steverob opened this issue Aug 15, 2017 · 2 comments

Comments

@steverob
Copy link

I'm trying to use webpack plugins that are detailed in this blog - https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a - webpack.DefinePlugin, webpack.optimize.UglifyJsPlugin, webpack.optimize.AggressiveMergingPlugin

And also I'm looking to add the compression plugin to generate gzip assets. Currently it's not generating gzip versions of bundles.

I'm wondering how to include this production environment configurations into the webpack config. Do I need to configure separate webpack configs for different environments?

Would love some help here.

@justin808
Copy link
Member

@steverob This gem is only a means to get from the manifest.json plus the webpack generated file to the view helper. I'm currently working on upgrading React on Rails to be based on Webpacker for 9.0.0. Please try out the beta!

@sourcepirate
Copy link

@steverob If you trying to make the build size smaller by compression it would be difficult to scale if the app size gets big. May be you should try using CommandChunks Plugin Which lets you seperate
vendor dependencies from application code.

If you need to generate the gzipped version of your bundle here is some config file for reference.
https://github.com/sourcepirate/devmap/blob/master/app/webpack.prod.js

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants