Skip to content

Commit

Permalink
fix: stats port
Browse files Browse the repository at this point in the history
  • Loading branch information
hubcarl committed Mar 29, 2018
1 parent 08b75f4 commit ede98df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions config/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ exports.analyzer = {
name: 'webpack-bundle-analyzer',
entry: 'BundleAnalyzerPlugin',
args() {
const prefix = this.dll ? 'dll' : this.type;
return {
analyzerPort: this.ssr ? 9998 : 9999,
statsFilename: this.type ? this.type + '_analyzer_stats.json' : 'analyzer_stats.json'
analyzerPort: this.dll ? 9997 : this.ssr ? 9998 : 9999,
statsFilename: prefix ? prefix + '_analyzer_stats.json' : 'analyzer_stats.json'
};
}
};
Expand All @@ -221,11 +222,12 @@ exports.stats = {
enable: false,
name: 'stats-webpack-plugin',
args() {
const prefix = this.dll ? 'dll' : this.type;
const args = [{
chunkModules: true,
exclude: [/node_modules[\\\/]/]
}];
args.unshift(this.type ? this.type + '_stats.json' : 'stats.json');
args.unshift(prefix ? prefix + '_stats.json' : 'stats.json');
return args;
}
};
Expand Down
1 change: 1 addition & 0 deletions lib/dll.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Config = require('../config/config');
class WebpackDllBuilder extends WebpackBaseBuilder {
constructor(config) {
super(merge({ useHost: false, buildDll: true }, config));
this.dll = true;
this.type = WebpackDllBuilder.TYPE;
this.mergeConfig(Config.dllConfig);
this.setBuildPath(this.utils.getDllCompileFileDir(this.env));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easywebpack",
"version": "4.2.1",
"version": "4.2.2",
"description": "基于 Webpack 的前端构建工程化解决方案",
"keywords": [
"webpack",
Expand Down

0 comments on commit ede98df

Please sign in to comment.