mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
chore: 📦 Add bundle-stats and relative-ci (#25501)
* 📦 Add bundle-stats and relative-ci
* bundle-stats-webpack-plugin
This commit is contained in:
parent
1a692de9e2
commit
17dd94fd07
@ -1,14 +0,0 @@
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"test": "./dist/antd.min.js",
|
||||
"maxSize": "300 kB",
|
||||
"compression": "gzip"
|
||||
},
|
||||
{
|
||||
"test": "./dist/antd.min.css",
|
||||
"maxSize": "65 kB",
|
||||
"compression": "gzip"
|
||||
}
|
||||
]
|
||||
}
|
@ -108,6 +108,7 @@
|
||||
"@ant-design/icons": "^4.2.1",
|
||||
"@ant-design/react-slick": "~0.26.1",
|
||||
"array-tree-filter": "^2.1.0",
|
||||
"bundle-stats": "^2.2.0",
|
||||
"classnames": "^2.2.6",
|
||||
"copy-to-clipboard": "^3.2.0",
|
||||
"lodash": "^4.17.13",
|
||||
@ -152,8 +153,8 @@
|
||||
"@ant-design/colors": "^4.0.0",
|
||||
"@ant-design/hitu": "^0.0.0-alpha.13",
|
||||
"@ant-design/tools": "^9.0.0",
|
||||
"@bundle-analyzer/webpack-plugin": "^0.5.1",
|
||||
"@qixian.cs/github-contributors-list": "^1.0.3",
|
||||
"@relative-ci/agent": "^1.3.0",
|
||||
"@stackblitz/sdk": "^1.3.0",
|
||||
"@types/classnames": "^2.2.8",
|
||||
"@types/enzyme": "^3.10.5",
|
||||
@ -179,6 +180,7 @@
|
||||
"bisheng-plugin-description": "^0.1.4",
|
||||
"bisheng-plugin-react": "^1.1.0",
|
||||
"bisheng-plugin-toc": "^0.4.4",
|
||||
"bundle-stats-webpack-plugin": "^2.2.0",
|
||||
"bundlesize": "^0.18.0",
|
||||
"chalk": "^4.0.0",
|
||||
"cheerio": "^1.0.0-rc.3",
|
||||
|
@ -3,7 +3,8 @@
|
||||
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig');
|
||||
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
const BundleAnalyzerPluginCom = require('@bundle-analyzer/webpack-plugin');
|
||||
const { BundleStatsWebpackPlugin } = require('bundle-stats-webpack-plugin');
|
||||
const { RelativeCiAgentWebpackPlugin } = require('@relative-ci/agent');
|
||||
const EsbuildPlugin = require('esbuild-webpack-plugin').default;
|
||||
const darkVars = require('./scripts/dark-vars');
|
||||
const compactVars = require('./scripts/compact-vars');
|
||||
@ -53,15 +54,16 @@ function injectWarningCondition(config) {
|
||||
});
|
||||
}
|
||||
|
||||
function addBundleAnalyzerPluginCom(config) {
|
||||
function addBundleStatsWebpackPlugin(config) {
|
||||
if (!process.env.CIRCLECI || process.env.RUN_ENV !== 'PRODUCTION') {
|
||||
return;
|
||||
}
|
||||
config.plugins.push(
|
||||
new BundleAnalyzerPluginCom({
|
||||
new BundleStatsWebpackPlugin({
|
||||
token: process.env.BUNDLE_ANALYZER_TOKEN,
|
||||
}),
|
||||
);
|
||||
config.plugins.push(new RelativeCiAgentWebpackPlugin());
|
||||
}
|
||||
|
||||
function processWebpackThemeConfig(themeConfig, theme, vars) {
|
||||
@ -122,7 +124,7 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
|
||||
}),
|
||||
);
|
||||
|
||||
addBundleAnalyzerPluginCom(config);
|
||||
addBundleStatsWebpackPlugin(config);
|
||||
});
|
||||
|
||||
processWebpackThemeConfig(webpackDarkConfig, 'dark', darkVars);
|
||||
|
Loading…
Reference in New Issue
Block a user