First and foremost, I understand how tsconfig.json works in general, but not completely. OK, here's my problem...
I am using the tsc
command line to compile my *.tsx files in a /lib
folder. Everything works fine, I can import the libraries and run my project.
When I am using my IDE (WebStorm), I can navigate to the definition doing CTRL+Click. However this brings me to the limited definition generated by the tsc command line. I would like to be redirected to my source file (the one that is within the /src
folder).
My library structure is the following:
/lib
/src
tsconfig.json
My tsconfig.json file contains the following:
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"jsx": "react",
"lib": [
"es2015", "dom"
],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"rootDir": "./",
"baseUrl": "./",
"paths": {
"@project/*": ["./packages/*/src"],
"*": ["node_modules", "packages"]
},
"typeRoots": [
"./packages/@types"
],
"resolveJsonModule": true
},
"include": [
"packages"
],
"exclude": [
"node_modules",
"**/*.spec.ts",
"packages/**/dist"
]
}
Objective:
I want to compile the /src
folder and thereafter being able to navigate to the original sources by doing a CTRL+CLICK on the component in my IDE (WebStorm) and also being able to debug the original source in Chrome.