Skip to content

Commit ede98df

Browse files
committed
fix: stats port
1 parent 08b75f4 commit ede98df

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

config/plugin.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ exports.analyzer = {
210210
name: 'webpack-bundle-analyzer',
211211
entry: 'BundleAnalyzerPlugin',
212212
args() {
213+
const prefix = this.dll ? 'dll' : this.type;
213214
return {
214-
analyzerPort: this.ssr ? 9998 : 9999,
215-
statsFilename: this.type ? this.type + '_analyzer_stats.json' : 'analyzer_stats.json'
215+
analyzerPort: this.dll ? 9997 : this.ssr ? 9998 : 9999,
216+
statsFilename: prefix ? prefix + '_analyzer_stats.json' : 'analyzer_stats.json'
216217
};
217218
}
218219
};
@@ -221,11 +222,12 @@ exports.stats = {
221222
enable: false,
222223
name: 'stats-webpack-plugin',
223224
args() {
225+
const prefix = this.dll ? 'dll' : this.type;
224226
const args = [{
225227
chunkModules: true,
226228
exclude: [/node_modules[\\\/]/]
227229
}];
228-
args.unshift(this.type ? this.type + '_stats.json' : 'stats.json');
230+
args.unshift(prefix ? prefix + '_stats.json' : 'stats.json');
229231
return args;
230232
}
231233
};

lib/dll.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const Config = require('../config/config');
88
class WebpackDllBuilder extends WebpackBaseBuilder {
99
constructor(config) {
1010
super(merge({ useHost: false, buildDll: true }, config));
11+
this.dll = true;
1112
this.type = WebpackDllBuilder.TYPE;
1213
this.mergeConfig(Config.dllConfig);
1314
this.setBuildPath(this.utils.getDllCompileFileDir(this.env));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easywebpack",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "基于 Webpack 的前端构建工程化解决方案",
55
"keywords": [
66
"webpack",

0 commit comments

Comments
 (0)