-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Speed up min builds #1933
Comments
I believe webpack is smart enough to strip out unneeded requires even before uglification so that might be faster than what we're doing… |
@spicyj Is it? I haven't actually checked, but I use |
I meant if you do |
@zpao, I had a similar problem with "dead requires" so I put together unreachable-branch - it's a browserify transform (jstransform visitor under-the-hood) to comment out unreachable branches in |
Some context... I did end up trying unreachable-branch and it mostly works (except it chokes on |
@spicyj is right that webpack is not only smart enough to strip out dead requires, but it strips out dead code paths entirely, so in your build (pre-minified code) instead of: ("production" !== "development" ? invariant(
children.nodeType !== 1,
'traverseAllChildren(...): Encountered an invalid child; DOM ' +
'elements are not valid children of React components.'
) : invariant(children.nodeType !== 1)); you just get the much nicer: invariant(children.nodeType !== 1,
'traverseAllChildren(...): Encountered an invalid child; DOM ' +
'elements are not valid children of React components.'
); |
wow I totally missed your response @zpao. I just pushed an updated version of Though, I was able to shave off 2 sec by turning off The real killer is |
I think at this point things are pretty fast. We'll make some more changes to the build process in general. |
We're minifiying twice thanks to
uglifyify
. We need this to remove dead requires. But it also doesn't minify all the way, so we still needuglify
as well. I haven't actually looked to see if there's a better way.The text was updated successfully, but these errors were encountered: