This reproduces two source map bugs in the Rspack adapter in unplugin:
- It drops the source map returned by a
transformhook when the loader receives no input source map. - It does not compose the returned transform map with an input map from an earlier loader.
pnpm install
pnpm repropnpm repro builds and checks both cases. It is expected to succeed. With [email protected], both cases fail:
Incorrect source maps:
without-input-map: expected source line 1, received line 2
with-input-map: expected source line 1, received line 2
The unplugin transform prepends one generated line and returns the corresponding source map. The second case also runs a preceding loader that prepends a line and returns its map. The verifier traces the generated statement through the final Rspack map; both should resolve to line 1 of src/index.js.
Related upstream fix: unjs/unplugin#615