Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with remapping when dist is run a second time (#37653)
This is fun. When babel performs internal remapping (when there is an input sourcemap), it just fails to output a valid sourcemap if the output has multiple source files (I actually recently fixed this...). When esbuild generates a sourcemap, it'll link to the map file with a `sourceMappingUrl` comment. Babel will try see that comment, and interpret the sourcemap as an input. And we hit the bug if the output has multiple sources. This works fine on the initial build, because the map file hasn't been written to disk yet. But on a re-dist, the map file will exist, and babel will read it. This will cause a bug in our `@ampproject/remapping`, because we see a transformation that outputs an invalid map (and we throw an error).
- Loading branch information