I have had this problem for the last 2 days. So I decided to completely disable uglifyjs-webpack-plugin
from webpack build process. I was not able to find anything on webpack 4.
To disable it, you can do --js-opts 0 which will disable the JS optimizer. For small JS sizes that's probably ok (and you can run your own JS minifier later if you want).
In webpack, minification process is controlled through two configuration fields: optimization. minimize flag to toggle it and optimization. minimizer array to configure the process. To tune the defaults, we'll attach terser-webpack-plugin to the project so that it's possible to adjust it.
Using Webpack v4, you have to install terser-webpack-plugin v4. const TerserPlugin = require("terser-webpack-plugin"); module. exports = { optimization: { minimize: true, minimizer: [new TerserPlugin()], }, }; And run webpack via your preferred method.
UglifyJS is a JavaScript compressor/minifier written in JavaScript. It also contains tools that allow one to automate working with JavaScript code: A parser which produces an abstract syntax tree (AST) from JavaScript code.
module.exports = {
optimization:{
minimize: false, // <---- disables uglify.
// minimizer: [new UglifyJsPlugin()] if you want to customize it.
}
}
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