How should I go about using the --optimize-minimize flag with webpack. What does adding that flag to the command do? Do I still need to add the UglifyJsPlugin to the plugins list in the webpack config if I am using the --optimize-minimize flag? Does it help me decide whether to add it to the list of plugins or not?
Tells webpack to determine and flag chunks which are subsets of other chunks in a way that subsets don't have to be loaded when the bigger chunk has been already loaded. By default optimization. flagIncludedChunks is enabled in production mode and disabled elsewise. webpack.config.js module. exports = { //...
Webpack v4+ will minify your code by default in production mode .
This plugin uses terser to minify/minimize your JavaScript.
What does adding that flag to the command do?
It will reduce your js/CSS files size.
Do I still need to add the UglifyJsPlugin to the plugins list in the webpack config if I am using the --optimize-minimize flag?
Same effect, so you can choose what you like.
Does it help me decide whether to add it to the list of plugins or not?
As a suggestion, always use this or use it before putting the code to production(maybe this process will slow down the building process).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With