I am creating a responsive application using the create-react-app tool, so it uses webpack to bundle modules. Having the following directory structure
-my-app
--node_modules
--src
To avoid many ../../(dotted slashes for a relative path), I set NODE_PATH=./srcas shown below in my package. json
"scripts": {
"start": "NODE_PATH=./src react-scripts start",
"build": "NODE_PATH=./src react-scripts build",
}
So now I can import my modules in my style
import SomeComponent from "/components/somecomponent/SomeComponent"
Thus, even changing the directory structure will not break my code so often. But with this, my VSCode does not recognize the paths and thus does not show intellisense, how can I fix it?
source
share