AlT
AlT
KPCKevin Powell - Community
Created by AlT on 6/19/2023 in #front-end
Vite/Rollup plugin to import CSS into React web component
I also asked on StackOverflow. Please refer to it for more info https://stackoverflow.com/questions/76509761/vite-rollup-plugin-hodtdiw-to-get-styling-css-module-into-a-react-web-component I am trying to create a Web Component from React. Web Components need you to import styles inside the Shadow DOM raw. Vite will normally inject your CSS into the document body (I think). I'd like to write a Vite plugin to collect all CSS imports from a starting component. It might have sub components that have their own CSS that I'd need to know about as well. Any help appreciated 🙏
2 replies