Describe the bug
When transforming JS files with server.transformRequest and enabled SSR flag, it returns invalid source map. sourceContent includes already processed import paths instead of the original ones.
To run code in reproduction:
It was noticed in Vitest, because snapshots rely on source maps: vitest-dev/vitest#1376
Reproduction
https://stackblitz.com/edit/vitejs-vite-pacs84?file=vite-repro.mjs&view=editor
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
When transforming JS files with
server.transformRequestand enabled SSR flag, it returns invalid source map.sourceContentincludes already processed import paths instead of the original ones.To run code in reproduction:
It was noticed in Vitest, because snapshots rely on source maps: vitest-dev/vitest#1376
Reproduction
https://stackblitz.com/edit/vitejs-vite-pacs84?file=vite-repro.mjs&view=editor
Used Package Manager
npm
Logs
No response
Validations