If other Vite plugin transformed vue code before vite-plugin-vue2, the code passed to transform() will be the modified code.
But if the code source is TypeScript, the esbuild transform result will miss some sourcemap fields like sourcesContent. it will cause rollup try to read source content from file system (its different from modified code) when generating sourcemap, so the final sourcemap cannot be mapped to current source.
This PR fixed it by adding missing fields from previous map.
If other Vite plugin transformed vue code before
vite-plugin-vue2
, the code passed totransform()
will be the modified code.But if the code source is TypeScript, the esbuild transform result will miss some sourcemap fields like
sourcesContent
. it will cause rollup try to read source content from file system (its different from modified code) when generating sourcemap, so the final sourcemap cannot be mapped to current source.This PR fixed it by adding missing fields from previous map.