Uh oh!
There was an error while loading. Please reload this page.
Add root imports with tilde prefix - #852
Conversation
This commit adds `babel-plugin-root-import` to the default .babelrc file to define `~` as the absolute path to the src/ folder. This gives us the possibility to turn code like this: ``` import SomeUtility from '../../utils/some-utility' ``` to this ``` import SomeUtility from '~/utils/some-utility'; ```
facebook-github-bot
commented
Oct 5, 2016
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
gaearon
commented
Oct 5, 2016
Thanks for the PR but this is not the approach we’re likely to take because it breaks many integrations and third-party tools. Instead, we intend to implement this approach: #741. If you could research that, and submit a PR for it, it would be very welcome! |
selbekk
commented
Oct 5, 2016
Oh... okay. |
@selbekk any update on this matter? I'm using the ducks model for my file structure. |
This commit adds
babel-plugin-root-importto the default.babelrcfile to define~as the absolute path to thesrc/folder.This gives us the possibility to turn code like this:
to this
The main upside of using this pattern in contrary to the approaches suggested in #741 is that it highlights what is a local import and what is a
node_moduleimport.Fixes#849.