Closed developit closed 4 years ago
@prateekbh I have an implementation now that I will PR ASAP.
Thanks i'll publish it ASAP after merging
I would like to send a PR for this issue, but I was stuck with a question
If I use terser-webpack-plugin
in this way
webpack.config.js
{
optimization: {
minimizer: [
{
apply( compiler ) {
const TerserPlugin = require( 'terser-webpack-plugin' )
new TerserPlugin( {
terserOptions: { output: { ecma: 5 } }
} ).apply( compiler )
}
}
]
}
}
Like what webpack defaults.js did
I can't access terser instance with parentCompiler.options.optimization.minimizer
anymore
Any advice for how to access and modify the terserOptions in this case please @prateekbh @developit
Sadly we lately realized that doing this wouldn't really make much of a difference in the output.
Not really worth putting much efforts in
The child compiler spawned by
babel-preset-modules
needs to change Terser's parsing and output modes toecma:8
in order to preserve arrow functions and other constructs, and to allow it to minify modern syntax effectively.