I am using create-react-app as scaffolding and tsconfig-paths as extension of my tsconfig because create-react-app is removing my paths when ran. I have been using this setup for a year now and I have no problems with it but recently when I created a project from scratch, it doesn't work anymore
tsconfig.json:
{
"extends": "./tsconfig-paths.json",
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"types": [
"cypress"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"downlevelIteration": true
},
"include": [
"src"
]
}
tsconfig-paths.json:
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"components/*": ["./components/*"],
"constants/*": ["./constants/*"],
"pages/*": ["./pages/*"],
"assets/*": ["./assets/*"],
"actions/*": ["./actions/*"],
"reducers/*": ["./reducers/*"],
"layouts/*": ["./layouts/*"],
"routes/*": ["./routes/*"],
"utils/*": ["./utils/*"],
"theme/*": ["./theme/*"],
"api": ["./api"],
"hooks": ["./hooks"],
"formdocuments/*": ["./formdocuments/*"],
"enums/*": ["./enums/*"]
}
}
}
scripts:
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},