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

Add optimize-js-plugin to webpack.config.prod.js #1383

Closed
wants to merge 1 commit into from

Conversation

ggregoire
Copy link

@ggregoire ggregoire commented Jan 12, 2017

This PR adds the optimize-js lib to the build process:

Benchmarks from @nolanlawson:

Browser Typical speed boost/regression using optimize-js
Chrome 55 20.63%
Edge 14 13.52%
Firefox 50 8.26%
Safari 10 -1.04%

@gaearon
Copy link
Contributor

gaearon commented Jan 12, 2017

Does(n't) Webpack 2 do it by default? Just asking since we'll move to it soon.

@ggregoire
Copy link
Author

I honestly have no idea. This comment makes me think that it doesn't do it.

@gaearon
Copy link
Contributor

gaearon commented Jan 12, 2017

Need to wait for this until vigneshshanmugam/optimize-js-plugin#7 is fixed since we're moving to Webpack 2 soon.

@nolanlawson
Copy link

As the author of optimize-js, I would not recommend it as a general-purpose tool for something like create-react-app.

Because optimize-js targets the existing behavior of JS engines using heuristics (one might say "hacks" even 😉) and because this behavior varies depending on the shape of the JS bundle, it's essential for users to run their own measurements (in multiple browsers, ideally!) and determine if optimize-js is really an improvement. For some bundles it may actually make things slower, and for Safari/JSCore most of my tests show it's basically a wash.

In other words, "ask your doctor if optimize-js is right for you." 😃

@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2017

Fair enough, thanks!

@gaearon gaearon closed this Jan 13, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants