From eecf3a239abc6a84cff39b6f91604a2d534d33ec Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Wed, 16 Nov 2016 21:51:50 -0500 Subject: [PATCH] Enable absolute import paths (such as "features/a/SomeComponent") 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: https://github.com/facebookincubator/create-react-app/pull/476 https://github.com/facebookincubator/create-react-app/pull/693 https://github.com/facebookincubator/create-react-app/issues/741 --- .env | 1 + .gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..f85aab1 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +NODE_PATH=src \ No newline at end of file diff --git a/.gitignore b/.gitignore index 161f6e2..776ed66 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ build # misc .DS_Store -.env npm-debug.log