add analysis (#20434)

This commit is contained in:
二货机器人 2019-12-25 15:18:31 +08:00 committed by GitHub
parent 7a520f1ba4
commit 193bf0f6b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -1 +1,2 @@
~*
dist/report.html

View File

@ -239,6 +239,7 @@
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^3.0.0",
"typescript": "~3.7.2",
"webpack-bundle-analyzer": "^3.6.0",
"xhr-mock": "^2.4.1",
"xhr2": "^0.2.0",
"yaml-front-matter": "^4.0.0"

View File

@ -3,6 +3,7 @@
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig');
const PacktrackerPlugin = require('@packtracker/webpack-plugin');
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { webpack } = getWebpackConfig;
@ -58,6 +59,10 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
fail_build: true,
exclude_assets: name => !['antd.min.js', 'antd.min.css'].includes(name),
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
}),
);
}
});