2018-12-16 01:36:36 +00:00
|
|
|
const TerserWebpackPlugin = require('terser-webpack-plugin')
|
2019-10-25 02:03:10 +00:00
|
|
|
const terserOptions = require('../bin/terserOptions')
|
2018-12-16 01:36:36 +00:00
|
|
|
|
2019-10-08 14:57:37 +00:00
|
|
|
module.exports = () => new TerserWebpackPlugin({
|
2019-10-15 03:00:57 +00:00
|
|
|
exclude: /(tesseract-asset|page-lifecycle)/, // tesseract causes problems, page-lifecycle is pre-minified
|
2019-10-08 14:57:37 +00:00
|
|
|
cache: !process.env.TERSER_DISABLE_CACHE,
|
2018-12-16 01:36:36 +00:00
|
|
|
parallel: true,
|
|
|
|
sourceMap: true,
|
2019-10-25 02:03:10 +00:00
|
|
|
terserOptions
|
2018-12-16 01:36:36 +00:00
|
|
|
})
|