Can we have webpack resolve for CRA? So it will help us a lot and provide better experience when developing.
Instead of import x from '../../where/my/module/is'; we can use import x from 'where/my/module/is';.
I suggest we include src as module resolved by default.
Sorry my bad, it already solved by adding NODE_PATH=src on .env.
@hellowin it does not work for me "react-scripts": "1.0.13",
I tried more cases src src/* ./src ./src/*
I ejected app looked into code, and it should add them, but nope :cry:
It seems .env ignores NODE_PATH, or how it works.
It's works only when added in front of npm script
"start": "NODE_PATH=$NODE_PATH:src react-scripts start",
That means it's probably already set on your system / environment. .env does not override already set variables.
@Timer yes, when I log NODE_PATH I get some system node paths
Most helpful comment
Sorry my bad, it already solved by adding
NODE_PATH=srcon.env.