-
-
Notifications
You must be signed in to change notification settings - Fork 98
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: Improve css sourcemap accuracy #305
Conversation
This is a great finding, thanks! The PR needs to be rebased due to conflicts |
some questions
|
a1deba2
to
65f58e1
Compare
Rebased and changed from split().pop() to using
or when using sveltekit to your svelte.config:
As you can see this a configuration option for vite, not the plugin.
I've also tested some sass using the To debug i've used https://evanw.github.io/source-map-visualization/ and pasted the results i logged in packages/vite-plugin-svelte/src/utils/compile.ts using:
|
Sorry my comment above wasn't very clear.
vite-plugin-svelte can set It could be added here:
unfortunately there are 2 options |
I would not auto enable it just yet, i've seen this experimental feature throw javascript exceptions during build/dev. I'd assume vite will enable the feature by default at some point. |
we can handle the config later in a separate PR, true. although i do lean on early adpoting things that improve the dev experience. and missing css sourcemaps has been a sore spot. |
final step missing before merge would be a changeset |
65f58e1
to
8507edb
Compare
8507edb
to
78bb807
Compare
👍 done! |
When using Vite's (experimental) css.devSourcemap feature
The filenames where correct, but the line numbers didn't match.
Changing:
source: filename
into
source: filename?.split(/[/\\]/).pop()
By changing
source
to only contain the filename instead of the full path fixed the line number issue.Fixes #300