TerserPlugin 비슷한 기능
uglifyJSWebpackPlugin 개발자들이 해당 플러그인을 더 이상 유지보수를 진행하지 않고 있는 반면, TerserPlugin은 계속 진행
, minify 속도에서도 차이 tenser가 더 좋음
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const path = require('path') module.exports = (env, argv) => ({ optimization: { minimizer: argv.mode === 'production' ? [ new UglifyJSPlugin({ uglifyOptions: { compress: { global_defs: { "@alert": "console.log", }, drop_console: true } } }) ] : [] } }
