Open RezaHaidari opened 6 years ago
@RezaHaidari in webpack.base.config.js you have added uglifyjsplugin with sourcemaps:
if (isProd) {
config.optimization = {
...config.optimization,
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
uglifyOptions: {
compress: {
inline: false,
},
},
}),
],
};
}
But it doesn't generate any sourcemaps, alos, how different is it compared to default optimisation webpack 4 does in --mode=production?
CommonsChunkPlugin is no longer needed, nor is UglifyJsPlugin. All of those options are abstracted in to options.optimization
. They are activated depending on options.mode
which should be set to either "development"
or "production"
@sirlancelot you are right. But I was also wondering how to enable sourcemaps in production with --mode=production. First I though this pull request is achiving that with uglifyjsplugin, but there must be an lternative with defaults.
great job @RezaHaidari works perfect for me. I have just upgraded based on your changes a project which is based on vue-hackernews.