Skip to content

Commit

Permalink
ci(coverage): add bundle analysis (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Sep 1, 2024
1 parent 8757b80 commit 9b3ddcf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
npm test
- name: Build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npm run build

- name: Upload test results to Codecov
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"devDependencies": {
"@babel/core": "7.25.2",
"@babel/preset-env": "7.25.4",
"@codecov/webpack-plugin": "0.0.1-beta.10",
"@eslint/js": "9.9.1",
"@jest/globals": "29.7.0",
"babel-loader": "9.1.3",
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const { codecovWebpackPlugin } = require("@codecov/webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

let production = process.env.NODE_ENV === 'production';
Expand Down Expand Up @@ -75,6 +76,12 @@ let config = {
new MiniCssExtractPlugin({
filename: '[name].css',
}),
// Put the Codecov webpack plugin after all other plugins
codecovWebpackPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "shared-web",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
resolve: {
extensions: ['.js'],
Expand Down

0 comments on commit 9b3ddcf

Please sign in to comment.