Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Use babel's sourceRoot option instead of sourceDir #12

Closed
per2plex opened this issue Aug 24, 2016 · 3 comments
Closed

Use babel's sourceRoot option instead of sourceDir #12

per2plex opened this issue Aug 24, 2016 · 3 comments
Assignees

Comments

@per2plex
Copy link
Owner

per2plex commented Aug 24, 2016

Babel's native sourceRoot option could be used instead of the plugins sourceDir, but this requires a major rewrite. This would also cleanup some confusing path joining.

Check compatibility with other plugins beforehand.
Also see: #8

@m59peacemaker
Copy link
Contributor

If I got this right, no more worries about confusing path joining. :)

https://www.npmjs.com/package/root-import-utils

getRelativePathToModule() or getLongRelativePathToModule() will take care of it all!

@m59peacemaker
Copy link
Contributor

I don't think sourceRoot does what I had in mind. It produces paths in the sourcemaps like src/../src/etc. I don't have any clue what that is useful for. Here's my plugin for requires.
https://github.com/m59peacemaker/babel-plugin-root-require

@per2plex
Copy link
Owner Author

per2plex commented Sep 7, 2016

So if I understand correctly, changing sourceRoot had an effect on the generated sourcemaps? Do you think it's not worth using this option?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants