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 21, 2016
1 parent 21393ed commit 922292f
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 922292f

Please sign in to comment.