Nested SASS Partials Sourcemap No Longer Working #18957
Labels
feat: sourcemap
Sourcemap support
p2-edge-case
Bug, but has workaround or limited in scope (priority)
Describe the bug
I have an pre- existing vite project that I am upgrading. Starting in Vite v5.3.5 and going up to the latest v6 release my sass partial files are not loading in the sourcemap, and dev tools only shows the initial imported file (styles.sass). If I revert back to v5.3.4 then my partial sass files are showing again.
I have looked through the changelog but I can't find any API changes that would resolve this issue.
Reproduction
https://stackblitz.com/edit/vitejs-vite-cicjj47e?file=src%2Fsass%2Fvendor%2Findex.scss%3AL98&terminal=dev
Steps to reproduce
npm install && npm run dev
Inspect the select2 element in the middle of the page. The sass selectors report the file as the primary imported file style.scss, when the real file that the styles are coming from is _select2.sass.
If you remove the
@import 'select2';
line at src/sass/vendor/index.scss:98 then the partial file will change from style.scss (incorrect) to index.scss (correct).Reverting to vite 5.3.4 also fixes the problem.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: