I\'m currently using create-react-app
to bootstrap one of my projects. Basically, I\'m trying to set up paths in tsconfig.json by adding these to the default ts
Create React App does not currently support baseUrl
. However there is a workaround...to setup baseUrl
for both webpack and the IDE you have to do the following:
.env
file with the following code:NODE_PATH=./
tsconfig.paths.json
file with the following code inside:{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"src/*": ["*"]
}
}
}
tsconfig.json
{
"extends": "./tsconfig.paths.json",
...
}