You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.
Unless I misunderstand, I haven't seen a Webpack config yet that uses the production React build in production. They all seem to get it from the npm package, which still prints warnings, checks PropTypes, etc. I'm trying to figure out if it's possible to configure Webpack so that I can require() React from this pre-bundled production build, so if you have any idea, would you mind letting me know?
The text was updated successfully, but these errors were encountered:
When you generate a production build you should be using webpack.DefinePlugin, and passing it { 'process.env.NODE_ENV': '"production"' }. That'll cause the conditional process.env.NODE_ENV !== "production" to becomes "production" !== "production", so uglifyjs will do dead code elimination and remove all the prop checks and warnings.
Oh, okay, cool! I had tried running webpack with the env command, but the output bundle was no smaller than before. Or maybe I don't have UglifyJS configured. But I wasn't aware of the DefinePlugin, that's good to know. Thanks!
Unless I misunderstand, I haven't seen a Webpack config yet that uses the production React build in production. They all seem to get it from the npm package, which still prints warnings, checks
PropTypes
, etc. I'm trying to figure out if it's possible to configure Webpack so that I canrequire()
React from this pre-bundled production build, so if you have any idea, would you mind letting me know?The text was updated successfully, but these errors were encountered: