microbundle icon indicating copy to clipboard operation
microbundle copied to clipboard

[Feature request] Use sourcemap files from imports

Open Fordi opened this issue 7 months ago • 0 comments

Using [email protected]

In a multistage build (such as when using peggy), I'd like the final output map file to make use of map files declared by imported files. For example, if I run:

npx peggy --format es --output src/grammar.mjs --source-map src/grammar.mjs.map src/grammar.pegjs
# generates src/grammar.mjs and src/grammar.mjs.map
# src/grammar.mjs ends with `//# sourceMappingURL=grammar.mjs.map`
# src/index.mjs has `import { parse } from "src/grammar.mjs";`
npx microbundle src/index.mjs --compress=false --strict=true --sourcemap=true

I'd expect the resultant sourcemap to contain a reference to `../src/grammar.pegjs". Instead, it contains a reference to "../src/grammar.mjs".

Fordi avatar May 20 '25 16:05 Fordi