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: specify sourceFileName when generating inline sourcemaps #10797

Merged
merged 1 commit into from Feb 7, 2020

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Dec 2, 2019

Q                       A
Fixed Issues? Fixes #10786
Patch: Bug Fix? Y
Tests Added + Pass? Nope
License MIT

In this PR we specify script url as the sourceFileName option when doing in-browser transforms, otherwise the generated sourcemap have incorrected sources fields
i.e.

On a script /foo/script.js

var a;
var b;

babel will generate the following source map since the default sourceFileName is path.relative(filename).

{"version":3,"sources":["script.js"],"names":["a","b"],"mappings":";;AAAA,IAAIA,CAAJ;AACA,IAAIC,CAAJ","sourcesContent":["var a;\nvar b;"]}

@nicolo-ribaudo nicolo-ribaudo merged commit 1599e90 into babel:master Feb 7, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the fix-10786 branch February 7, 2020 21:42
rajasekarm pushed a commit to rajasekarm/babel that referenced this pull request Feb 17, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: sourcemaps outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: standalone PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File with the same name, chrome debugger breakpoint location is confused
2 participants