next.js
a2085ed8 - Turbopack: add the missing separator when resolving sourceRoot (#101098)

Commit
19 hours ago
Turbopack: add the missing separator when resolving sourceRoot (#101098) ## Summary Fix source-map paths when a nonempty `sourceRoot` does not end in `/`. For example, `sourceRoot: "src"` and `sources: ["page.js"]` now resolve to `src/page.js` instead of `srcpage.js`, matching webpack-sources. Extend the existing source-map resolution test with relative roots, percent-encoded paths, file and HTTPS URLs, trailing and leading slash controls, and empty or absent roots. ## Verification - Confirmed the expanded regression test fails with the original concatenation and passes with the fix restored. - `cargo test -p turbopack-core --lib`: 229 passed, 2 ignored. Used a canonical `TMPDIR` on macOS to avoid unrelated `/var` versus `/private/var` resolver-test failures. - Compared all 11 source-root joining cases against the actual webpack-sources v3.2.3 (the repository-pinned version) and v3.3.3 helpers. - `cargo clippy -p turbopack-core --lib --tests -- -D warnings` passed. - No application or compatibility-matrix run was performed. <!-- NEXT_JS_LLM --> --------- Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Author
Parents
Loading