-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Next.js新分支 #86174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
Next.js新分支 #86174
Changes from 4 commits
871c7d5
f0f44d5
c933aa2
9f0b36b
9f491e2
4e92981
1c04cc8
e8f6bf1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| name: NodeJS with Webpack | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [ "canary" ] | ||||||
| pull_request: | ||||||
| branches: [ "canary" ] | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| strategy: | ||||||
| matrix: | ||||||
| node-version: [18.x, 20.x, 22.x] | ||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Use Node.js ${{ matrix.node-version }} | ||||||
| uses: actions/setup-node@v4 | ||||||
| with: | ||||||
| node-version: ${{ matrix.node-version }} | ||||||
|
|
||||||
| - name: Install pnpm | ||||||
| uses: pnpm/action-setup@v2 | ||||||
| with: | ||||||
| version: 8 | ||||||
|
|
||||||
| - name: Build | ||||||
| run: | | ||||||
| pnpm install | ||||||
| npx webpack | ||||||
|
Comment on lines
+30
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow now runs Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The workflow will fail because View DetailsAnalysisWebpack workflow fails with missing configuration and entry pointWhat fails: The GitHub Actions workflow in How to reproduce: # Clone the repo and run the workflow steps:
pnpm install
npx webpackResult: Expected: The workflow should successfully test webpack functionality using the existing test suite, not fail with missing module resolution. Fix: Changed the workflow to run
Comment on lines
+25
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The webpack workflow is missing pnpm store caching, which will cause significantly slower builds since dependencies need to be re-downloaded on every run. This is inconsistent with other workflows in the repository. View Details📝 Patch Detailsdiff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml
index 3b68272b91..299d869f76 100644
--- a/.github/workflows/webpack.yml
+++ b/.github/workflows/webpack.yml
@@ -27,6 +27,18 @@ jobs:
with:
version: 8
+ - id: get-store-path
+ run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
+
+ - uses: actions/cache@v4
+ timeout-minutes: 5
+ id: cache-pnpm-store
+ with:
+ path: ${{ steps.get-store-path.outputs.STORE_PATH }}
+ key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
+ restore-keys: |
+ pnpm-store-
+
- name: Build
run: |
pnpm install
AnalysisMissing pnpm store caching in webpack.yml workflowWhat fails: The webpack.yml GitHub Actions workflow does not cache the pnpm store, resulting in dependencies being re-downloaded on every workflow run, while other workflows in the repository (build_and_deploy.yml and create_release_branch.yml) explicitly cache the pnpm store. This creates inconsistency and slower build times. How to reproduce:
Expected behavior: Per pnpm continuous integration documentation and GitHub Actions setup-node documentation, the workflow should cache the pnpm store path to avoid re-downloading dependencies. The pattern used in other workflows in this repository adds a Fix applied: Added pnpm store caching steps matching the established pattern in other workflows, improving build performance and maintaining consistency across the repository. |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direct
npx webpackcommand may fail since it requires webpack to be installed and properly configured. Next.js projects typically use their own build system through commands likepnpm build, which would leverage the project's existing configuration. Consider replacing this with the appropriate Next.js build command to ensure compatibility with the project's build pipeline.Spotted by Graphite Agent

Is this helpful? React 👍 or 👎 to let us know.