I can't use baseUrl and paths props of tsconfig.json to improve my imports statements.
I have this in my tsconfig file:
"baseUrl": "./src",
"paths": {
"@app/*": [
"./app/*"
],
},
And I'm trying to import like this:
import DataTable from '@app/shared/components/DataTable/DataTable'
After reload I got this error message:
Failed to compile
./src/app/modules/items/components/States.tsx
Module not found: Can't resolve '@app/shared/components/DataTable/DataTable' in 'C:\Users\rafael.rodrigues\Documents\projects\SigISS_Front\src\app\modules\items\components'
I have the DataTable component in this path:
/src/app/shared/components/DataTable/DataTable.tsx
Hi,
Your question is related to the CRA
, not to the Metronic itself, cause we haven't changed any base setup from CRA.
Anyway, here is some solutions for alliances in the app: https://plusreturn.com/blog/how-to-configure-a-path-alias-in-a-react-typescript-app-for-cleaner-imports/.
Regards,
Keenthemes support
What must I do here to achieve this?