Skip to content

Commit cf71687

Browse files
authored
chore: add swc-build-native script at root package.json (vercel#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.
1 parent 303d155 commit cf71687

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

contributing/core/building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can build Next.js, including all type definitions and packages, with:
66
pnpm build
77
```
88

9-
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`.
9+
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`.
1010

1111
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.
1212

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"version": "pnpm install --no-frozen-lockfile && IS_PUBLISH=yes ./scripts/check-pre-compiled.sh && git add .",
5858
"prepare": "husky",
5959
"sync-react": "node ./scripts/sync-react.js",
60-
"update-google-fonts": "node ./scripts/update-google-fonts.js"
60+
"update-google-fonts": "node ./scripts/update-google-fonts.js",
61+
"swc-build-native": "pnpm --filter=@next/swc build-native"
6162
},
6263
"devDependencies": {
6364
"@actions/core": "1.10.1",

0 commit comments

Comments
 (0)