-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
perf: use magic-string hires boundary for sourcemaps #13971
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Awesome work! Tempted to release this one in a patch, but it is probably better to merge it in the Vite 5 beta. @bmeurer maybe you could help us check this one out? |
I ran the benchmark at https://github.com/vitejs/vite-benchmark/actions/runs/5689588084 and it doesn't seem to affect performance, so maybe it only helps a bit or the benchmark fixtures aren't generating many sourcemaps. |
Awesome that you implemented this! @bmeurer suggested a similar way a bit ago (#13514 (comment)) to me.
I guess that's because vitejs/vite-benchmark doesn't run benchmarks for build. |
I think it should be rather safe to merge this one. It shouldn't degrade the sourcemap when using it. |
Ok, let's try it out |
Nice one, thanks! This might be interesting to bring up with the TC39-TG4 in the context of source map standardization. cc @jaro-sevcik @littledan |
Description
Generate sourcemap segments per word boundary instead of per character. Rich-Harris/magic-string#255
I didn't test this a lot but I think everything should stay the same. We're using magic-string to manipulate JS and CSS, which are code that are semantically separated by word boundaries.
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).