-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
feature / enhancementNew feature or requestNew feature or requestpkg:svelte-packageIssues related to svelte-packageIssues related to svelte-package
Milestone
Description
Describe the problem
It should be possible to export a single Component as a .js file with inlined CSS. This is super useful for building micro-frontends. With sveltes new capability to attach to a shadow-dom, single components can be exported and be used in another app by ether calling new Component(...) or by using svelte:fragment.
Currently this can only be achieved by using a separate rollup config.
Describe the proposed solution
Just another key in the config to describe which files should be exported and in which format.
Example svelte.config.js:
...
const config = {
...
external: [
{
input: 'lib/Example.svelte',
output: 'external/Example.js',
format: 'iife'
}
]
...
}
...Alternatives considered
Use vites library mode. Currently this leads to the error "UMD and IIFE output formats are not supported for code-splitting builds."
Importance
would make my life easier
Additional Information
No response
Metadata
Metadata
Assignees
Labels
feature / enhancementNew feature or requestNew feature or requestpkg:svelte-packageIssues related to svelte-packageIssues related to svelte-package