Commit 9c93972
Fix preview tarball script to include @next/swc-linux-x64-gnu (#91099)
### What?
Adds `@next/swc-linux-x64-gnu` to the preview tarball patching script
(`scripts/patch-preview-tarball.mjs`):
1. Adds the package to the `PACKAGES_TO_PATCH` list so its tarball URL
is fetched.
2. Adds the package as an explicit dependency in the patched
`package.json`, in addition to the overrides/resolutions.
### Why?
The `@next/swc-linux-x64-gnu` native binary package is an optional
dependency of `next` and may not be installed automatically depending on
the platform/package manager. When testing preview tarballs (e.g., in CI
or on Linux environments), the SWC binary needs to be explicitly present
for Next.js to function correctly. Without this change, preview tarball
testing on Linux x64 could fail because the native binary isn't resolved
from the preview build.
Adding it as a direct dependency (not just an override/resolution)
ensures the package manager actually installs it, since optional
dependencies from overridden tarballs may not be auto-resolved.
### How?
- Added `'@next/swc-linux-x64-gnu'` to the `PACKAGES_TO_PATCH` array so
the script fetches its tarball URL.
- After writing overrides/resolutions, the script now also adds
`@next/swc-linux-x64-gnu` as an explicit entry in `pkg.dependencies`
pointing to the tarball URL.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 5a22623 commit 9c93972
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
| |||
0 commit comments