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 4e3f463
Show file tree
Hide file tree
Showing 4 changed files with 23 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
.next
target
packages/next/wasm/@next
packages/next/next-bundle*.json

# dependencies
node_modules
Expand Down
2 changes: 2 additions & 0 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ import getRouteFromAssetPath from '../shared/lib/router/utils/get-route-from-ass
import { stripInternalHeaders } from './internal-utils'
import { RSCPathnameNormalizer } from './future/normalizers/request/rsc'

console.log('test2')

export type FindComponentsResult = {
components: LoadComponentsReturnType
query: NextParsedUrlQuery
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 4e3f463

Please sign in to comment.