Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

feat: Transform relative "sources" paths in source map #41

Merged
merged 1 commit into from
May 22, 2019

Conversation

bengourley
Copy link
Contributor

@bengourley bengourley commented May 20, 2019

When compiling a directory with Babel, the paths in the sources array of each source map contains relative paths from the output directory to the original file, e.g. ../../src/lib/logger.js.

This change resolves that path relative to the projectRoot setting so that the paths look correct in the dashboard.

Before

image

After

image

Testing

Unit tests have been added for this.

You can test this out manually (as I did for the screenshots above) using the Babel example project.

Be sure to replace the API key in examples/babel/package.json and examples/babel/src/services/bugsnag.js before you begin.

cd examples/babel
npm run build
npm run upload-source-maps
npm start

Compare the results on this branch with the results on the directory-mode master branch (driectory-mode is now merged) .

@bengourley bengourley changed the base branch from directory-mode to master May 22, 2019 12:38
@tomlongridge tomlongridge self-assigned this May 22, 2019
Copy link

@tomlongridge tomlongridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed - all good.

@bengourley bengourley merged commit da781d3 into master May 22, 2019
@bengourley bengourley deleted the transform-relative-paths branch May 22, 2019 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants