[Vuejs]-Ignore ESLint rule in Uglify in Vue build script

0👍

If you are using webpack. First of all get the most recent version of uglify and its webpack plugin

npm install uglify-es --save-dev
npm install uglifyjs-webpack-plugin --save-dev

then on your src/build folder search for the file with named “webpack.prod.conf.js”

at the end of the import statements add

var UglifyJSPlugin = require('uglifyjs-webpack-plugin')

next override the plugin named “new webpack.optimize.uglifyjsplugin” with the following code

new UglifyJSPlugin({
  uglifyOptions: {
    parallel: {
      cache: true,
      workers: true
    },
    compress: {
      warnings: false,
    },
    output: {
      comments: false
    }
  },
  sourceMap: true
}),

this worked for me 😉

Leave a comment