Skip to content

Commit

Permalink
upload webpack-bundle-analyzer stats artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Oct 24, 2023
1 parent 679a398 commit c44f4a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- run: pnpm install
if: ${{ inputs.skipInstallBuild != 'yes' }}

- run: pnpm build
- run: ANALYZE=1 pnpm build
if: ${{ inputs.skipInstallBuild != 'yes' }}

- run: pnpm playwright install-deps
Expand All @@ -186,6 +186,12 @@ jobs:
name: turbo run summary
path: .turbo/runs

- name: Upload bundle analyzer artifacts
uses: actions/upload-artifact@v3
with:
name: webpack bundle analysis stats
path: packages/next/dist/compiled/next-server/report.*.html

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
if: ${{ inputs.afterBuild }}
Expand Down
13 changes: 13 additions & 0 deletions packages/next/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,19 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => {
bundleType
),
openAnalyzer: false,
...(process.env.CI
? {
analyzerMode: 'static',
reportFilename: path.join(
__dirname,
`dist/compiled/next-server/report.${dev ? 'dev' : 'prod'}-${
turbo ? 'turbo' : 'webpack'
}-${
experimental ? 'experimental' : 'stable'
}-${bundleType}.html`
),
}
: {}),
}),
].filter(Boolean),
stats: {
Expand Down

0 comments on commit c44f4a8

Please sign in to comment.