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
Use envify + NODE_ENV=production for smaller JS bundle #2635
Conversation
Just double-checked, and this also correctly uses |
Shouldn't |
Yes, I added it to the |
Yes but it fails (module can't be found) when |
What do you mean "it fails"? In this PR I'm not even setting |
Ah wait, I forgot to update |
Note that #2617 would make this PR obsolete. |
As foretold, obsolete through #2617 :P |
* Further reduce CSS differences with upstream * Reduce differences in markup and CSS with upstream * Redo collapsible post notifications * Reduce CSS differences further * Reduce differences with upstream regarding `.status` and `.status__wrapper` * Further reduce differences with upstream * Reduce differences with upstream in DisplayName
* Further reduce CSS differences with upstream * Reduce differences in markup and CSS with upstream * Redo collapsible post notifications * Reduce CSS differences further * Reduce differences with upstream regarding `.status` and `.status__wrapper` * Further reduce differences with upstream * Reduce differences with upstream in DisplayName
This uses envify as a global Browserify transform to replace usages of
process.env.NODE_ENV
with"production"
whenRAILS_ENV
is also set to"production"
, which allows Uglify to remove non-essential code. It also makes it soreact-addons-perf
is omitted in production mode, since it's not worthwhile in production (it just instrumentsperformance.mark
/performance.measure
s in React's APIs).Before this PR,
application.js
is 2.96 MB (2963246 bytes to be exact, 514 kB gzipped). After, it's 2.95 MB (2952387 bytes to be exact, 512 kB gzipped).