Closed clodal closed 6 years ago
@clodal Thanks, I will be happy to accept PRs on both of your issues here. Please note that you can override optimization.minimize
as well as any other webpack config parts via webpackConfig
option already:
https://github.com/sysgears/spinjs#webpack-babel-and-other-tool-specific-config-merging
Issue
In
spinjs/src/plugins/WebpackPlugin.ts:54
, we are manually adding UglifyJSPlugin like so:However, since Webpack v4, setting
mode
toproduction
should already perform UglifyJs optimisations by default (see webpack discussion).Reference:
Including UglifyJsPlugin manually like how we do now, causes side-effects during the compilation, as I have faced in my downstream app and also evident from the stackoverflow question above.
Recommendation
Remove the UglifyJsPlugin and ensure minification is done by default with webpack v4’s
optimization.minize
. Also expose theoptimization.minimizer
config to allow end-users to override the default minimizer.Reference:
— Happy to submit PR, thanks!