chore: add swc-build-native script at root package.json (#67345)

When developing in Next.js repo, the maintainers / contributors
sometimes need to build swc native files.

Added a script `swc-build-native` to run the command `pnpm
--filter=@next/swc build-native` which was verbose to run.
This commit is contained in:
Jiwon Choi 2024-07-01 23:10:07 +09:00 committed by GitHub
parent 303d155c08
commit cf71687d69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,7 @@ You can build Next.js, including all type definitions and packages, with:
pnpm build
```
By default, the latest canary of the `next-swc` binaries will be installed and used. If you are actively working on Rust code or you need to test out the most recent Rust code that hasn't been published as a canary yet, you can [install Rust](https://www.rust-lang.org/tools/install) and run `pnpm --filter=@next/swc build-native`.
By default, the latest canary of the `next-swc` binaries will be installed and used. If you are actively working on Rust code or you need to test out the most recent Rust code that hasn't been published as a canary yet, you can [install Rust](https://www.rust-lang.org/tools/install) and run `pnpm swc-build-native`.
If you want to test out the wasm build locally, you will need to [install wasm-pack](https://rustwasm.github.io/wasm-pack/installer/). Run `pnpm --filter=@next/swc build-wasm --target <wasm_target>` to build and `node ./scripts/setup-wasm.mjs` to copy it into your `node_modules`. Run next with `NODE_OPTIONS='--no-addons'` to force it to use the wasm binary.

View file

@ -57,7 +57,8 @@
"version": "pnpm install --no-frozen-lockfile && IS_PUBLISH=yes ./scripts/check-pre-compiled.sh && git add .",
"prepare": "husky",
"sync-react": "node ./scripts/sync-react.js",
"update-google-fonts": "node ./scripts/update-google-fonts.js"
"update-google-fonts": "node ./scripts/update-google-fonts.js",
"swc-build-native": "pnpm --filter=@next/swc build-native"
},
"devDependencies": {
"@actions/core": "1.10.1",