Skip to content
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(ssr): combine empty source mappings #19226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Jan 19, 2025

Description

Current SSR transform skips collapsing map: { mappings: '' } and uses magic-string generated map as is. However this is incorrect since empty mappings should get collapsed to empty mappings. Additionally, magic-string source map generation is unnecessary, so it can be skipped in this case.

This change fixes a perf hit when plugin returns a large code from load or transform with explicit empty mappping map: { mappings: '' } as par rollup convention https://rollupjs.org/plugin-development/#source-code-transformations.

@hi-ogawa hi-ogawa marked this pull request as ready for review January 19, 2025 02:11
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable sourcemap generation in dev for large files, i.e Astro 5's data layer
2 participants