Skip to content

Commit 256f679

Browse files
committed
fix: uglifyjs-webpack-plugin repeat and open cache
1 parent 5407751 commit 256f679

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

config/config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ exports.config = {
1515
check: false
1616
},
1717
loaders: {},
18-
plugins: {}
18+
plugins: {},
19+
optimization: {
20+
minimize: false
21+
}
1922
};
2023

2124
exports.devConfig = {

config/plugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,14 @@ exports.runtime = {
9898
};
9999

100100
exports.uglifyJs = {
101-
enable: true,
101+
enable() {
102+
const config = this.config;
103+
return !(config.optimization && config.optimization.minimize);
104+
},
102105
env: ['prod'],
103106
name: 'uglifyjs-webpack-plugin',
104107
args: {
108+
cache: true,
105109
parallel: UGLIFYJS_WORKERS,
106110
uglifyOptions: {
107111
warnings: false,

0 commit comments

Comments
 (0)