diff --git a/.bundle-analyzerrc.json b/.bundle-analyzerrc.json deleted file mode 100644 index f571bce80d..0000000000 --- a/.bundle-analyzerrc.json +++ /dev/null @@ -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" - } - ] -} diff --git a/package.json b/package.json index e37339b8ef..08d83040b9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webpack.config.js b/webpack.config.js index e657940aab..48c4ed7f57 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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);