Skip to content

Commit

Permalink
Enable absolute import paths (such as "features/a/SomeComponent")
Browse files Browse the repository at this point in the history
There's been numerous requests for Create-React-App to support having
imports resolved relative to the "src" folder.  The semi-documented
solution is to have a NODE_PATH environment variable, which will be
used in the resolution process.  It's apparently also possible to
specify that variable in a file named ".env".

References:

facebook/create-react-app#476
facebook/create-react-app#693
facebook/create-react-app#741
  • Loading branch information
markerikson committed Nov 17, 2016
1 parent fb2f7cc commit eecf3a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_PATH=src
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ build

# misc
.DS_Store
.env
npm-debug.log


Expand Down

0 comments on commit eecf3a2

Please sign in to comment.