Skip to content

Commit

Permalink
chore: add analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Jun 24, 2019
1 parent b619a84 commit 665649c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -69,6 +69,7 @@
"react-logo": "^1.0.15",
"style-loader": "^0.21.0",
"webpack": "^4.10.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.0.1",
"webpack-dev-server": "^3.1.4",
"xutil": "1"
Expand Down
8 changes: 7 additions & 1 deletion webpack.config.js
@@ -1,6 +1,7 @@
'use strict';

const path = require('path');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

const pkg = require('./package');

Expand Down Expand Up @@ -40,7 +41,12 @@ const config = {
]
}
]
}
},
plugins: [],
};

if (process.env.npm_config_report) {
config.plugins.push(new BundleAnalyzerPlugin());
}

module.exports = config;

0 comments on commit 665649c

Please sign in to comment.