I'm moving my projects to a monorepo with Lerna and yarn workspace. I managed to setup the basic stuffs but I'm stuck with this issue and can't find similar problem on the web.
As you can see on the image below I'm unable to make path alias intellisense working for the "current" package src. You know the one we declare like this in a normal project in tsconfig
"paths": {
"@/*": [
"src/*"
]
},
When I open directly the packages/pro-app folder in vscode it works fine, but when I open the root monorepo, I have this issue
Webpack build works fine also
this is the <root>tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"strictNullChecks": false,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
and packages/pro-app/tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"strictNullChecks": false,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
I tried different paths configs but I can't make it work :/
Is it still possible to use "@/*" alias in a monorepo ?
Or maybe I shouldn't open the monorepo in vscode ? juste package by package
Thank you