Fix column offsets for source mapped code #197
Merged
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #189
The problem was, the column offsets were off-by-one when esbuild was disabled, but they were fine when esbuild was enabled.
Something like this:
The reason for this ended up being that the
source-map
library uses zero-indexed columns, while almost everything else uses 1-indexed columns. Once I found this out it was easy to fix.Along the way, I found out that
@rollup/plugin-babel
doesn't work, so I fixed it (the plugin required that theoptions
hook got called, so I added theoptions
hook to our fake rollup). I think it is important for this plugin to work since it will probably be pretty common for people to a specific babel setup that can't be replaced with esbuildThe tests cover both changes ✅