diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c88e8a..4bf17b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/package.json b/package.json index 899a534..b5d98d3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webpack.config.js b/webpack.config.js index 295c28b..32bfd50 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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'; @@ -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'],