Having some trouble with my Vue3 app. I've implemented UglifyJS to remove console.logs in production environments, but it seems to be inconsistent. Sometimes it works fine, other times not so much. Every time I have to rebuild and hope for the best. Is there a configuration issue that I'm overlooking?
//vue.config.js
const UglifyJSPlugin = require("uglifyjs-webpack-plugin")
.
.
.
configureWebpack: config => {
//added for local testing purposes
if (process.env.NODE_ENV === "development") {
// configure for production...
config.optimization.minimizer = [
new UglifyJSPlugin({
test: /\.vue(\?.*)?$/i,
uglifyOptions: {
compress: {
drop_console: true
}
}
})
]
}
}
The removal of console.logs seems to work inconsistently. Most logs are hidden, but sometimes they still appear. Any ideas on what might be missing from my setup?