fix minification

This commit is contained in:
notgne2 2019-12-23 16:41:42 -07:00
parent 31cb962156
commit 9d281ec79f

View File

@ -20,13 +20,16 @@ const magicFile = (text) => {
// const magicAppend = (orig, text, sep = '\n') => magicFile(fs.readFileSync(orig) + sep + text) // const magicAppend = (orig, text, sep = '\n') => magicFile(fs.readFileSync(orig) + sep + text)
const jsMin = { const jsMin = {
pure_funcs: ['F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9'],
pure_getters: true,
keep_fargs: false,
unsafe_comps: true,
unsafe: true,
compress: true,
mangle: true, mangle: true,
compress: {
keep_fargs: false,
pure_getters: true,
pure_funcs: ['F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9'],
unsafe: true,
ecma: 6,
unsafe_comps: true,
unsafe_arrows: true,
}
} }
const htmlMin = { const htmlMin = {
@ -107,10 +110,14 @@ module.exports = {
} }
], ],
}, },
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({ terserOptions: jsMin }),
new TerserPlugin({ terserOptions: jsMin }),
],
},
plugins: [ plugins: [
new TerserPlugin({
terserOptions: jsMin,
}),
new CopyPlugin([{ from: 'data', to: 'data' }, { from: 'wand.js', to: 'wand.js' }]), new CopyPlugin([{ from: 'data', to: 'data' }, { from: 'wand.js', to: 'wand.js' }]),
new ImageminPlugin({ new ImageminPlugin({
jpegtran: { progressive: true }, jpegtran: { progressive: true },