Hello. UglifyJS in webpack3.1 does not work, and there are no errors or warnings, when changing the parameter SourceMap: true, there is also a zero response. I use standard:

const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); new UglifyJSPlugin({ sourceMap: true, test: /\.js($|\?)/i, exclude: /\/node_modules/, include: /\/dist/ }); devtool: 'source-map' 

In this configuration, I try to build Angular5

typescript works, scss too, but as if the minifier is just missing and doesn’t react to anything. What could be the "snag"?

    1 answer 1

    I do not know what the error is but it works for me

     const webpack = require('webpack'); module.exports = function(){ return{ plugins:[ new webpack.optimize.UglifyJsPlugin({ sourceMap: true, compress: { warnings:false, }, output:{ comments: false, } }) ] } };