UglifyJS throws unexpected token: keyword (const) with node_modules

后端 未结 7 1880
清歌不尽
清歌不尽 2020-12-13 16:31

A small project I started make use a node module (installed via npm) that declares const variables. Running and testing this project is well, b

7条回答
  •  一整个雨季
    2020-12-13 17:30

    Use uglify-es-webpack-plugin is better

        const UglifyEsPlugin = require('uglify-es-webpack-plugin')
    
    
    
        module.exports = {
        plugins: [
                new UglifyEsPlugin({
                    compress:{
                        drop_console: true
                    }
                }),
        ] 
        }
    

提交回复
热议问题