mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
When using `Bun.build()` with a `root` option and external sourcemaps, the sourcemap `sources` paths were incorrectly relative to the output directory instead of the specified root directory. For example, with `root: "."` and `outdir: "./dist"`, source paths were being generated as `"../src/index.ts"` (relative to `dist/src/`) instead of `"src/index.ts"` (relative to root). The fix changes both JS and CSS sourcemap generation to use `root_dir` instead of `output_dir` when relativizing source file paths. Fixes #3332 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>