I'm trying to configure my project to use absolute imports, so I have configured jsconfig.json
as follows:
{
"compilerOptions": {
"baseUrl": "./src",
"module": "commonjs",
"target": "es2016"
},
"exclude": ["node_modules", "**/node_modules/*"]
}
My project structure looks like this:
but when I try to do an import like import { Account } from "models";
I get the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'models' imported from...
How can I solve this ?