.env NODE_PATH is not working in v1.0.0
Created by: CodinCat
Description
I have NODE_PATH=src
in .env
, it did work great in v0.9.5. After yarn upgrade react-scripts
it doesn't work now. And I didn't see any related guide in the v1.0.0 changelog.
(referenced from https://github.com/facebookincubator/create-react-app/issues/2188)
I've also tried in a fresh new project and it doesn't work.
Expected behavior
Should be able to import 'foo/bar'
which foo
is a folder located in src
Actual behavior
Module not found: Can't resolve 'foo/bar' in '/Users/some/path/src'
Environment
Run these commands in the project folder and fill in their results:
-
npm ls react-scripts
(if you haven’t ejected): v1.0.0 -
node -v
: v7.1.0 -
npm -v
: v3.10.9
Then, specify:
- Operating system: macOS Sierra
- Browser and version: Chrome 58
Reproducible Demo
https://github.com/CodinCat/cra-env-issue
This is a fresh new project. See /src/index.js:5