Fix sourcemaps #232
Merged
Fix sourcemaps #232
Conversation
- A mapping should not be written at the current position when writing a newline character, as that would put a mapping on a non-existent column of the generated file. - A mapping must be written for each line when writing multiline content because each generated line is independant in the mappings. Not adding these mapping would cause generated content to stay unmapped (the compressed formatter is not impacted as it puts everything on one line but the expanded formatter is impacted a lot)
|
I tested this using the bootstrap framework, generating file sourcemaps (I hacked When analysing the source-map with https://github.com/danvk/source-map-explorer, it reports 22% of unmapped content without the fix in the formatter to map all lines (disabling border checks due to the issue of adding a mapping when writing |
|
oh, and the fix for multiline writes was found by looking at how dart-sass builds its source maps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Closes #231