This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
[Recipe] Use Svelte and web components interchangeably in a codebase. #41
Labels
good first issue
Good for newcomers
Proposed Recipe
Using a combination of Rollup and file extensions.
Custom Element components get the extension .wc.svelte. Rollup then sets the customElement config depending on the file extension.
This works smoothly with local and NPM imported components.
Demo: https://jawish.github.io/svelte-customelement-rollup/
Originally posted by @jawish in sveltejs/svelte#3594 (comment)
This pattern is also pretty handy for creating other preprocessed files such as rich text markdown using something like MDsveX.
Eg:
The text was updated successfully, but these errors were encountered: