Skip to content

Commit

Permalink
chore: add @codecov/webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 23, 2024
1 parent 92b3aa6 commit d0d5255
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CodecovWebpackPlugin from '@codecov/webpack-plugin';
import { defineConfig } from 'father';

export default defineConfig({
Expand Down Expand Up @@ -31,5 +32,19 @@ 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;
},
},
});
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit d0d5255

Please sign in to comment.