neutrinojs / neutrino Public
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
Switch to terser-webpack-plugin #1158
Conversation
or even use a different minifier, override `optimization.minimizer`. | ||
|
||
Note: If switching to [babel-minify-webpack-plugin](https://github.com/webpack-contrib/babel-minify-webpack-plugin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've intentionally removed this reference to babel-minify-webpack-plugin, since it's still virtually unmaintained/buggy/slow. If that changes in the future we can re-add.
I was thinking about this PR some more today. Since we manually configure module.exports = {
use: [
['@neutrinojs/react', {
// ...
}],
(neutrino) => {
if (process.env.NODE_ENV === 'production') {
neutrino.config.devtool('source-map');
}
},
]
}; In this case, we'll pass The only thing I think we can do, is to perhaps add a warning (or throw) in the webpack() handler, like we do for the @eliperelman, thoughts? |
@edmorley I think that solution will work, but we should probably use a warning since it may be desired by the user to have them out of sync for some reason. |
Since the webpack 4 default of `uglifyjs-webpack-plugin` uses `uglify-es`, which has been deprecated in favour of `terser`. webpack 5 is due to use `terser-webpack-plugin`, at which point we can remove this. `terser` includes multiple correctness and performance fixes not present in `uglify-es`. Fixes #1146.
I've updated the PR:
|
Since as of webpack 4.26.0 `terser-webpack-plugin` is the new default, so we no longer need to set it manually: https://github.com/webpack/webpack/releases/tag/v4.26.0 This is a partial revert of #1158.
Since the webpack 4 default of
uglifyjs-webpack-plugin
usesuglify-es
, which has been deprecated in favour ofterser
. webpack 5 is due to useterser-webpack-plugin
, at which point we can remove this.terser
includes multiple correctness and performance fixes not present inuglify-es
.Fixes #1146.