Skip to content

Commit

Permalink
ci(codecov): enable JavaScrit bundle analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Dec 6, 2024
1 parent ecf62b8 commit c057f77
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@codecov/rollup-plugin": "^1.5.1",
"@emotion/babel-plugin": "^11.10.0",
"@emotion/jest": "^11.10.0",
"@rollup/plugin-babel": "^6.0.0",
Expand Down
13 changes: 13 additions & 0 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import { fileURLToPath } from 'url';
import { codecovRollupPlugin } from '@codecov/rollup-plugin';
import { babel } from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';

Expand All @@ -26,6 +27,12 @@ export default [
plugins: [
nodeResolve(),
babel({ babelHelpers: 'bundled' }),
// Put the Codecov rollup plugin after all other plugins
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: '@tonic-ui/react/dist/cjs/index.js',
uploadToken: process.env.CODECOV_TOKEN,
}),
],
},
{
Expand All @@ -39,6 +46,12 @@ export default [
plugins: [
nodeResolve(),
babel({ babelHelpers: 'bundled' }),
// Put the Codecov rollup plugin after all other plugins
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: '@tonic-ui/react/dist/esm/index.js',
uploadToken: process.env.CODECOV_TOKEN,
}),
],
}
];
Loading

0 comments on commit c057f77

Please sign in to comment.