I am using setup directive on SFCs which composes other components with module imports, and I generate builds with vite with sourcemaps enabled.
What I expect is to have sourcemaps generated for all the components I have in the project.
What happening is, vite ignores to generate sourcemaps for some components, depending on the content in the script tag with the setup directive. Inside the pages folder of the reproduction URL, there are various examples of single file components failing and succeeding generating sourcemaps.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Related plugins
[X] plugin-vue
[ ] plugin-vue-jsx
Describe the bug
I am using setup directive on SFCs which composes other components with module imports, and I generate builds with vite with sourcemaps enabled.
What I expect is to have sourcemaps generated for all the components I have in the project.
What happening is, vite ignores to generate sourcemaps for some components, depending on the content in the script tag with the
setup
directive. Inside the pages folder of the reproduction URL, there are various examples of single file components failing and succeeding generating sourcemaps.Reproduction
https://stackblitz.com/edit/vitejs-vite-1qo3gs?file=README.md&view=editor
Steps to reproduce
pnpm build
to generate the dist folder.pnpm test
to test the generated sourcemaps.SourcemapFails-xxx.js.map
files underdist/assets
folder manually.System Info
Used Package Manager
pnpm
Logs
Validations