Skip to content

Commit

Permalink
added bundle analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
hazal-karakus committed Dec 30, 2024
1 parent faf3b5d commit e788fd7
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run_codecov_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Run React tests
run: |
npm install
./build.sh
npm test -- --coverage --reporters=jest-junit
working-directory: ./empower/react
- uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion react/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ rm -rf build
# npm ci does not update minor versions ->
# (1) less chance of breaking (2) less noise in PR from package-lock.json
npm ci
npm run build # defined in 'scripts' in package.json
CI=false npm run build # defined in 'scripts' in package.json

12 changes: 9 additions & 3 deletions react/config-overrides.js.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
const reactsourceMapPlugin = require('@acemarke/react-prod-sourcemaps');
const { codecovWebpackPlugin } = require('@codecov/webpack-plugin');

module.exports = function override(config, env) {
//do stuff with the webpack config...
Expand All @@ -8,7 +9,6 @@ module.exports = function override(config, env) {
mode: 'strict',
})
);

config.plugins.push(
SentryWebpackPlugin.sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
Expand All @@ -18,8 +18,14 @@ module.exports = function override(config, env) {
ignoreFile: '.sentrycliignore',
ignore: ['webpack.config.js'],
configFile: 'sentry.properties',
reactComponentAnnotation: {enabled:true},
})
);
config.plugins.push(
codecovWebpackPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "example-webpack-bundle",
uploadToken: process.env.CODECOV_TOKEN,
})
);
return config;
};
};
Loading

0 comments on commit e788fd7

Please sign in to comment.