You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working in a monorepo, you can use path alias and includes from the tsconfig to import svelte files from shared libraries.
This works fine until you add a new file inside a shared package, it just does not appear in the intellisense until you restart the svelte language server.
example svelte.config.js and tsconfig.json
importadapterfrom'@sveltejs/adapter-auto';import{vitePreprocess}from'@sveltejs/vite-plugin-svelte';/** @type {import('@sveltejs/kit').Config} */constconfig={// Consult https://kit.svelte.dev/docs/integrations#preprocessors// for more information about preprocessorspreprocess: vitePreprocess(),kit: {// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.// If your environment is not supported or you settled on a specific environment, switch out the adapter.// See https://kit.svelte.dev/docs/adapters for more information about adapters.adapter: adapter(),alias: {"$ui": "../ui/src/lib","$ui/*": "../ui/src/lib/*",}}};exportdefaultconfig;
And inside the tsconfig.json it has the ui src/lib folder in includes
Reproduction instructions given in readme of repo.
Expected behaviour
Any files added should appear in the auto-complete list.
I should note this does work in typescript files just fine, its only .svelte files that it doesn't work.
System Info
OS: Windows
IDE: VS Code
Svelte: 4
SvelteKit: 2
Which package is the issue about?
No response
Additional Information, eg. Screenshots
A workaround can be to package the files, but this can cause issues when working with working with tailwind in a monorepo, and slows down the developer experience.
#2233#2393
update project files(tsconfig.include) when a new client file is opened. So files included in both tsocnfig.json will be loaded into the respecting language service.
Describe the bug
When working in a monorepo, you can use path alias and includes from the tsconfig to import svelte files from shared libraries.
This works fine until you add a new file inside a shared package, it just does not appear in the intellisense until you restart the svelte language server.
example svelte.config.js and tsconfig.json
And inside the tsconfig.json it has the ui src/lib folder in includes
Reproduction
https://github.com/datstarkey/svelte-monorepo-import-issue
Reproduction instructions given in readme of repo.
Expected behaviour
Any files added should appear in the auto-complete list.
I should note this does work in typescript files just fine, its only .svelte files that it doesn't work.
System Info
Which package is the issue about?
No response
Additional Information, eg. Screenshots
A workaround can be to package the files, but this can cause issues when working with working with tailwind in a monorepo, and slows down the developer experience.
You can also add the files to the index.ts and export, but that can be annoying during development. Vite prefers to not have barrel files aswell - https://vitejs.dev/guide/performance#avoid-barrel-files
The text was updated successfully, but these errors were encountered: