What is the correct way to use PurgeCSS in Svelte 5? #14392
Unanswered
JLAcostaEC
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm creating a component library, and one of the things I'm aware of is the amount of unnecessary CSS that is sent to the frontend. I'm using PostCSS (and yes, I initially thought about using TailwindCSS, but due to various problems I discarded the idea) and I've included PurgeCSS, however, after trying hundreds of configurations (options and regex), I've only managed to get all the rules to be lost.
I must point out that I can't use a safelist because by including the
s-
orsvelte-
class, all the content is being sent without any purging, this is because the svelte compiler places said class at the beginning of all the components.If anyone knows anything about this, or has any ideas on what I should do, I would really appreciate your help.
Beta Was this translation helpful? Give feedback.
All reactions