uglifyOptions config is not working in webpack 5
See original GitHub issueDescribe the bug In quasar.conf.js file, I use uglifyOptions to drop console log in production, but since I upgraded to webpack 5, it’s no longer working. There’s my config:
build: {
scopeHoisting: true,
vueRouterMode: 'history', // available values: 'hash', 'history'
showProgress: true,
gzip: false,
analyze: false,
// drop console
uglifyOptions: {
compress: { pure_funcs: ['console.log'] }
},
extendWebpack (cfg) {
if (cfg.output) {
cfg.plugins.push(new CopyWebpackPlugin({
patterns: [{ from: './wTFg6cBrWb.txt', to: cfg.output.path }, { from: './MP_verify_2fJZiZCzjBnVRnZ2.txt', to: cfg.output.path }]
}))
}
},
chainWebpack (chain) {
const nodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin')
chain.plugin('node-polyfill').use(nodePolyfillWebpackPlugin)
}
},
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
UglifyJS and webpack v5 - Stack Overflow
It appears that UglifyJS does not work with webpack v5. Is there an alternative? We need something that works with babel-loader. Thanks. webpack...
Read more >UglifyjsWebpackPlugin | webpack
This plugin uses uglify-js to minify your JavaScript. Requirements. This module requires a minimum of Node v6.9.0 and Webpack v4.0.0. Getting Started.
Read more >Top 5 webpack Code Examples - Snyk
Learn more about how to use webpack, based on webpack code examples created from the most popular ways it is used in public...
Read more >uglifyjs-webpack-plugin - npm
Start using uglifyjs-webpack-plugin in your project by running `npm ... UglifyJsPlugin is scheduled for webpack v4.0.0 ... webpack.config.js.
Read more >webpack/webpack - Gitter
Webpack has been initialised using a configuration object that does not match the ... The problem is that i am using knex.js and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is my solution, hoping to help people needed. Adding
excludeAliases
to tellPloyfill
ignore console.THANKS for your detailed information, appreciated!!! After hours of debugging, I finally found where the problem is.
My project has the dependency
node-polyfill-webpack-plugin
forcrypto
lib. When I runquasar build
, it will firstly transcriptconsole
to random letter such asIn that case, Uglify can’t find console key words to drop, as a result issue remains.
So my following question is **How can I set
minimizer
work beforenode-polyfill-webpack-plugin
**