diff --git a/.fatherrc.ts b/.fatherrc.ts index da2935d4..88b77621 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -1,5 +1,22 @@ +import { codecovWebpackPlugin } from '@codecov/webpack-plugin'; import { defineConfig } from 'father'; +class CodecovWebpackPlugin { + private options; + constructor(options = {}) { + this.options = { + enableBundleAnalysis: true, + bundleName: 'webpack-bundle', + gitService: 'github', + disable: false, + ...options, + }; + } + apply(compiler: any) { + return codecovWebpackPlugin(this.options).apply(compiler); + } +} + export default defineConfig({ plugins: ['@rc-component/father-plugin'], esm: { @@ -31,5 +48,18 @@ export default defineConfig({ '@ant-design/cssinjs': 'antdCssinjs', antd: 'antd', }, + chainWebpack: (memo) => { + if (process.env.NODE_ENV === 'production') { + memo.plugin('codecov').use(CodecovWebpackPlugin, [ + { + enableBundleAnalysis: true, + bundleName: 'antdx', + uploadToken: process.env.CODECOV_TOKEN, + gitService: 'github', + }, + ]); + } + return memo; + }, }, }); diff --git a/bun.lockb b/bun.lockb index cc8ca67a..47019051 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index d5dbc89a..0022d8a4 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "devDependencies": { "@ant-design/tools": "^18.0.2", "@biomejs/biome": "^1.9.0", + "@codecov/webpack-plugin": "^1.4.0", "@codesandbox/sandpack-react": "^2.19.8", "@emotion/server": "^11.11.0", "@happy-dom/jest-environment": "^15.7.4", @@ -173,7 +174,7 @@ "dumi-plugin-color-chunk": "^1.1.2", "esbuild-loader": "^4.2.2", "fast-glob": "^3.3.2", - "father": "4.5.1", + "father": "4.5.1-beta.4", "fetch-jsonp": "^1.3.0", "fs-extra": "^11.2.0", "gh-pages": "^6.1.1",