next.js
e95129b5 - next-swc: rebuild native when embedded js/src files change (#99669)

Commit
1 day ago
next-swc: rebuild native when embedded js/src files change (#99669) ## Summary `pnpm build-all` decides whether to build the native binary with `packages/next-swc/maybe-build-native.mjs`. That script `git diff`s against the last version-bump commit, and only builds when `.rs`, `.toml`, `.cargo/**`, `Cargo.lock` or `rust-toolchain` files changed. Several crates compile a `js/src` directory into the binary with `embed_directory!`: next-core, turbopack-ecmascript-runtime, turbopack-ecmascript, turbopack-node, turbopack-wasm and turbopack-cli. Editing only those files counted as "no Rust changes", so the script skipped the build. It then deleted the local `native/*.node` in favor of the prebuilt npm binary, so local runtime changes silently never took effect. This adds `crates/*/js/src/**` and `turbopack/crates/*/js/src/**` to the pathspec. ## Verification - With only `turbopack-ecmascript-runtime/js/src` files modified, the `git diff --name-only` in `hasRustChanges` now lists them, so the build runs. Before this change it printed nothing. <!-- NEXT_JS_LLM -->
Author
Parents
Loading