rsnext/contributing/core/building.md
OJ Kwon 6f8c580386
feat(turbopack): Experimental wasm build (#57906)
### What?

continuation of https://github.com/vercel/next.js/pull/57851, since it is from a remote branch that I don't have access to write.

Co-authored-by: Maia Teegarden <2865858+padmaia@users.noreply.github.com>
Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2023-11-02 21:00:54 +00:00

872 B

Building

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 and run pnpm --filter=@next/swc build-native.

If you want to test out the wasm build locally, you will need to install wasm-pack. 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.

If you need to clean the project for any reason, use pnpm clean.