esbuild-plugin-vue3
esbuild-plugin-vue3 copied to clipboard
Add support for `defineCustomElement` styles property
With the release of vue 3.2, defineCustomElement is officially supported and it has a specialized property called styles that can be added on that will append the styles in the shadow dom.
Sadly, this property is not handled in the compiler but in the bundler (here is vite's method for dealing with it):
https://github.com/vitejs/vite/blob/1809fccab6267a68336b8374428a88c0514f4ac7/packages/plugin-vue/src/main.ts#L340-L345
We are looking to be able to leverage using custom elements at work with vue3, and we are using your plugin as part of our build process. Would it be possible to get some form of support for appending styles for custom elements?
Let me know if you would like more information (I can also attempt helping to make a PR for it.)
Absolutely. It'd be really helpful if you could send me an MVP that uses this feature, that way I can easily test it out.