-
-
Notifications
You must be signed in to change notification settings - Fork 233
Description
I've used this template to initialize a monorepo project with Turborepo.
When I click on MyCounterButton (used in apps/docs/src/routes/+page.svelte) or run "Go to Definition", the source file for MyCounterButton does not open.
Also, when I run "Svelte: Find File References" from MyCounterButton.svelte (located in packages/ui/src/MyCounterButton.svelte), only references inside the current package are found. References from apps/docs/src/routes/+page.svelte are not detected.
Partial workaround
"Go to Definition" can be fixed by adding the following configuration to tsconfig.json in apps/docs and apps/web:
{
"extends": [
"@repo/typescript-config/svelte.json",
"./.svelte-kit/tsconfig.json"
],
"compilerOptions": {
"strictNullChecks": true,
"paths": {
"@repo/ui": ["../../packages/ui"],
"@repo/ui/*": ["../../packages/ui/*"]
}
}
}Attempt to fix "Find File References"
To try to fix "Svelte: Find File References", I created a root tsconfig.json like this:
{
"files": [],
"references": [
{ "path": "./apps/docs" },
{ "path": "./apps/web" },
{ "path": "./packages/ui" }
]
}However, this did not help. Also, the Turborepo documentation discourages this approach:
Question
Is this a known issue with the Svelte language tools in a Turborepo monorepo setup?
Is there any additional configuration required to make "Find File References" and "Go to Definition" work correctly across packages?