Use alias to get rid of ../ paths for modules #117
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lots of ../../.. in the source and in the docs made things pretty cumbersome. Now, there's an alias
@
which points to the root directory. I went with@
instead of a name likeroot
just to avoid any confusion thinking there's a real npm module with that name.Also, this could have been done with a single babel plugin, but there seems to be some concern that jest or webpack caching may break, so instead I went with tool-specific plugins/settings for webpack/jest/rollup. See tleunen/babel-plugin-module-resolver#346 and other issues for details on the potential problem with the babel plugin.
For now, I kept all the
./
sibling paths. I'd be find switching those to absolute, but there isn't as much to gain there, so I just left them for now.cc @stevelikesmusic I'll be merging this right away to keep things moving, but feel free to continue the convo if you have any other opinions here.