-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Proper React minification #2200
Comments
Since you already include the uglifyify transform, the repeated call to uglify won't do much. IIRC, browserify doesn't minfy the file paths in In production, I'm using webpack with basically this config (for testing purposes, the vendor file only includes react):
The output file is 106kB, |
I bet the transforms run in order, so |
This isn't really an issue with React so I'm going to close this out. Feel free to keep discussing though. In the future, this might be a better question for stack overflow or the mailing list. |
Thanks for the tips guys, I'll take it up with uglifyify |
I don't think there's anything to take up, uglifyify just doesn't know code is dead yet so it can't remove it until after you run envify. |
I'm wondering about the best way to minify React for production builds.
The guide @christianalfoni wrote for #2046 is very comprehensive so I used it as a boilerplate. However, after adding envify, uglify, and uglifyify, my build is 131KB, 5KB bigger then the standard react.min.js.
Uglifyify doesn't seem to be doing anything so I'm guessing that's the problem. But since there are so many moving parts it's hard to pin down exactly what's going wrong, so some kind of boilerplate would be great.
My gulp task looks like this:
main.js looks like this:
The text was updated successfully, but these errors were encountered: