'Mixing Svelte and Web Components results in "Did you forget the 'customElement: true' compile option?"
I am building a component library, where I'm mixing Svelte and HTML5 Web Components.
My rollup configuration is based on this example:
plugins: [
...
/** Handle HTML5 Web Components **/
svelte({
include: /\.wc\.svelte$/,
preprocess: sveltePreprocess({
sourceMap: !production,
}),
compilerOptions: {
customElement: true,
// enable run-time checks when not in production
dev: !production
},
// store CSS in JavaScript
emitCss: false
}),
/** Handle Svelte Components **/
svelte({
exclude: /\.wc\.svelte$/,
preprocess: sveltePreprocess({
sourceMap: !production,
}),
compilerOptions: {
customElement: false,
// enable run-time checks when not in production
dev: !production
},
// we'll extract any component CSS out into
// a separate file - better for performance
emitCss: true
}),
...
But Svelte keeps giving me:
Warn: The 'tag' option is used when generating a custom element. Did you forget the 'customElement: true' compile option? (svelte)
How to get rid of this warning, while supporting both, custom elements and Svelte components?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
