Skip to content

Commit 3793e8a

Browse files
committed
support codecov bundle analysis
# Conflicts: # package.json # yarn.lock
1 parent fa052d2 commit 3793e8a

File tree

4 files changed

+292
-18
lines changed

4 files changed

+292
-18
lines changed

.github/workflows/create-new-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ jobs:
7474
- name: Install dependencies
7575
run: yarn install
7676

77-
# Build assets
78-
- run: yarn build
79-
- run: npm pack
77+
- name: Compile assets bundle
78+
run: yarn build
79+
env:
80+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
81+
82+
- name: Pack bundle tarball
83+
run: npm pack
8084

8185
- name: Create Release
8286
id: create_release

.storybook/webpack.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
const path = require('path');
2+
const { codecovWebpackPlugin } = require("@codecov/webpack-plugin");
23

34
module.exports = function({ config }) {
5+
config.plugins = config.plugins || [];
6+
config.plugins.push(
7+
codecovWebpackPlugin({
8+
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
9+
bundleName: "design-system",
10+
uploadToken: process.env.CODECOV_TOKEN,
11+
}),
12+
);
13+
414
config.module.rules.push({
515
test: /\.scss$/,
616
use: [

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@babel/preset-react": "^7.28.5",
9595
"@babel/preset-typescript": "^7.28.5",
9696
"@babel/runtime": "^7.28.4",
97+
"@codecov/webpack-plugin": "^1.9.1",
9798
"@eslint/compat": "^1.4.1",
9899
"@fortawesome/fontawesome-svg-core": "^6.7.2",
99100
"@fortawesome/free-brands-svg-icons": "^6.7.2",

0 commit comments

Comments
 (0)