-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Sourcemap for "/path/to/Component.svelte" points to missing source files #621
Conversation
thank you for posting this. Please add a changeset with |
bdfc423
to
e14bae1
Compare
Interesting, the sourcemap from the unittest i'm writing does use relative paths and a sourceRoot before it is processed by the
|
e14bae1
to
6eeab48
Compare
I've added an e2e test, so it keeps working as intended #305 😉. Tip: If you paste the contents of the snapshot from |
Thanks for adding the testcase. I'm not sure using a sourcemap visualizer to be able to understand the snapshot is a good idea as it puts extra work on the maintainers every time the snapshot changes to find out why exactly it suddenly failed. A unit test calling vitePreprocess().style directly could be better. The filenames being relative already could be vite having improved in the meantime or because this is css and it's only a simple input. If there was additional config, eg a banner or scss imports leading to more entries in map.sources, the situation could be different. For this PR I think it is sufficient to make sure that the extra lang suffix is stripped from the file refs in map |
Closing in favor of the 625 |
When using Vite's css.devSourcemap: true and using
<style lang="scss">
processed withvitePreprocess
will result in broken source maps for the css.Example vite log:
This is caused by the the fake filename that is passed to the
transform
function (which is needed so vite will select the appropriate transformation).This PR repairs the SourceMap to use the original filename.