更换最小化插件

pull/204/MERGE
ChenX 6 years ago
parent c70c11ee13
commit d3f60e376d

@ -1,6 +1,5 @@
import * as webpack from 'webpack';
import * as path from 'path';
import UglifyJSPlugin = require('uglifyjs-webpack-plugin');
import { outputDir } from './outputPath';
const dllName = "dll"
@ -32,14 +31,6 @@ const config: webpack.Configuration = {
name: dllName,
context: __dirname,
}),
new UglifyJSPlugin(
{
sourceMap: true,
cache: true,
extractComments: true,
parallel: 4
}
)
],
};

@ -1,7 +1,7 @@
import * as webpack from 'webpack';
import * as merge from 'webpack-merge';
import common from './webpack.common';
import UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const config: webpack.Configuration = merge(
common,
@ -11,28 +11,11 @@ const config: webpack.Configuration = merge(
optimization: {
minimizer: [
new UglifyJSPlugin(
{
sourceMap: true,
cache: true,
extractComments: true,
parallel: true,
uglifyOptions: {
output: {
beautify: false,
},
// mangle: {
// properties: {
// // mangle property options
// // keep_quoted: true 混淆属性
// debug: true //因为混淆了THREE库导致的错误.
// }
// },
keep_classnames: true,
toplevel: true,
},
}
)
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true
})
]
}
}

@ -29,7 +29,6 @@
"@types/react-dom": "^16.0.11",
"@types/stats.js": "^0.17.0",
"@types/three": "^0.93.10",
"@types/uglifyjs-webpack-plugin": "^1.1.0",
"@types/webpack": "^4.4.20",
"@types/webpack-dev-server": "^3.1.1",
"@types/webpack-env": "^1.13.6",
@ -54,6 +53,7 @@
"shader-loader": "^1.3.1",
"source-map-loader": "^0.2.4",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.1.0",
"ts-jest": "^23.10.5",
"ts-loader": "^5.3.1",
"ts-node": "^7.0.1",

Loading…
Cancel
Save