You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I am using Vite in module mode to build a Vue 3 project that defines 4 web components with shadow root enabled. The components share lots of common CSS, which currently is inlined as <style> tags into each shadow root, and thus is loaded once for each component on a page.
I'd like to try using tags in the shadow DOM hoping the browser will download the CSS only once, however I can't figure out how to configure Vite to achieve this?
I have searched existing issues & discussions but I can't find a clear explanation of how to control how Vite treats imported styles. Ideally I'd like this to work in dev mode.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
I am using Vite in module mode to build a Vue 3 project that defines 4 web components with shadow root enabled. The components share lots of common CSS, which currently is inlined as <style> tags into each shadow root, and thus is loaded once for each component on a page.
I'd like to try using tags in the shadow DOM hoping the browser will download the CSS only once, however I can't figure out how to configure Vite to achieve this?
I have searched existing issues & discussions but I can't find a clear explanation of how to control how Vite treats imported styles. Ideally I'd like this to work in dev mode.
Currently the project looks like this:
main.ts
dayEvents.ts:
PMDayEvents.vue
Any help with this would be greatly appreciated... thanks!
Franck
Beta Was this translation helpful? Give feedback.
All reactions