-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix line numbers in case of commonJS file with no sourcemap
Previously if someone imports or runs a commonJS file (one that won't need to go through babel) we still need to wrap it in some code to run it. But we don't have a sourcemap to update, unless it already had one(internal babel adds it). This leads to all lines being off by 1. This is fixed by updating the sourcemap in the other case. Unfortunately short of generating an "identity" sourcemap and then shifting it by 1 with adding `;` to the first mapping, this can't be done. The sourcemap implementation specifically wants to find each mapping, so unless it can do that it will not do anything. The remaining hack (adjusting any available sourcemap) still stands as it also fixes the columns on the *first* line of the file. As well as actually being better.
- Loading branch information
Showing
6 changed files
with
53 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters