next.js
9c939729 - Fix preview tarball script to include @next/swc-linux-x64-gnu (#91099)

Commit
79 days ago
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>
Author
Parents
Loading