Reputation: 15303
I added a .env
file with my project as :
NODE_PATH=src/
- so later on I import the components like:
import Subtitle from "Components/Subtitle";
instead of regular approach as import Subtitle from "./Components/Subtitle";
since .env
added the path.
But still not works as expected.
What is the mistake here i do? How to define the base path, if this is wrong? Any one help me here?
Upvotes: 0
Views: 92
Reputation: 6086
.evn
to .env
..env
file. In your case it should be NODE_PATH=src/
.And here's forked codesandbox
Upvotes: 1