In https://github.com/webpack/docs/wiki/optimization it states using -p to make it use UglifyJS. But it does not indicate how to set the options for UglifyJS. e.g. semicolons
Please note it should only do the uglify on -p not every build
In https://github.com/webpack/docs/wiki/optimization it states using -p to make it use UglifyJS. But it does not indicate how to set the options for UglifyJS. e.g. semicolons
Please note it should only do the uglify on -p not every build
Copyright © 2021 Jogjafile Inc.
Update: As you might aware that
-pis nothing but the production shortcut for--optimize-minimize --optimize-occurrence-order. If webpack find a config file in current directory, it takes theUglifyJsPluginconfiguration from the config file.And when you wanted to add a configuration only in production mode, you could do like,
If you have
webpack.config.jsfile, you can add theUglifyJsPluginas shown below with the options you want. Thesemicolonsoption is part ofoutputoption.