According to the links below I understand .env with NODE_PATH=src in it, allows the react app to take advantage of Absolute Path Imports without ejecting.
so far I've managed to load REACT_APP_TEST_VAR in my process.env which indicates the file is being loaded ! but i cant import anything from src
or src/components folder
So far I've tried moving the NODE_PATH into .env && .env.development restarting node and webpack, rebooting the system
Environment
Environment:
OS: Linux 4.15
Node: 9.10.0
Yarn: 1.7.0
npm: 6.4.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.4.2 => 16.4.2
react-dom: ^16.4.2 => 16.4.2
react-scripts: ^1.1.5 => 1.1.5
Steps to Reproduce
- Add .env with NODE_PATH
- in any component expect to be able to import from NODE_PATH specified path
- react complain "Module not found: Can't resolve" in child component
According to the links below I understand .env with
NODE_PATH=srcin it, allows the react app to take advantage of Absolute Path Imports without ejecting.so far I've managed to load REACT_APP_TEST_VAR in my process.env which indicates the file is being loaded ! but i cant import anything from src
or src/components folder
So far I've tried moving the NODE_PATH into .env && .env.development restarting node and webpack, rebooting the system
Environment
Environment:
OS: Linux 4.15
Node: 9.10.0
Yarn: 1.7.0
npm: 6.4.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.4.2 => 16.4.2
react-dom: ^16.4.2 => 16.4.2
react-scripts: ^1.1.5 => 1.1.5
Steps to Reproduce