Files
ESP3D-WEBUI/webpack/plugins/terser-plugin.js
2020-03-17 16:50:27 +01:00

35 lines
772 B
JavaScript

/**
* This plugin is used to minify your JavaScript.
* Docs: https://github.com/webpack-contrib/terser-webpack-plugin
*/
import TerserPlugin from "terser-webpack-plugin"
const config = {
parallel: true,
cache: false,
sourceMap: false,
terserOptions: {
parse: {
// Let terser parse ecma 8 code but always output
// ES5 compliant code for older browsers
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
comparisons: false,
},
mangle: {
safari10: true,
},
output: {
ecma: 5,
comments: false,
ascii_only: true,
},
},
}
export default () => new TerserPlugin(config)