Open winston0410 opened 2 years ago
Is there another way to aviod this to build a library?
I don't think we can support defining pages as webcomponents (see original reproduction adding it to src/routes/index.svelte which is the equivalent of +page.svelte today)
But it is possible to compile some .svelte files as web-components with vite-plugin-svelte's dynamicCompileOptions
, see this comment https://github.com/sveltejs/vite-plugin-svelte/issues/270#issuecomment-1033190138
You'd still have to solve registering them once if you want to use them in your own sveltekit application and HMR won't work. Packaging them as an npm package for consumption in other apps should work too.
thank you , i am sorry to occupy up your time! I am fresh to svelte. Can this support to build a library to be used in angular ,vue or react. hope to have a demo about this :)
@dominikg thank you for the demo. It works for me.
Describe the bug
I got this error, when I set the following compiler options:
The received error:
Reproduction
git clone https://github.com/winston0410/sveltekit-custom-element cd ./sveltekit-custom-element npm i npm run dev
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response