FullHuman / postcss-purgecss

PostCSS plugin for purgecss
MIT License
91 stars 5 forks source link

Removes classes that are dynamically created #22

Closed MrToph closed 5 years ago

MrToph commented 5 years ago

Hi, in my code I use some classes like this:

<li className={`cols-${headers.length}`}>Hello</li>

which I defined for cols-1, cols-2, ..., cols-5.

Purgecss cannot infer this and removes all of these classes from the output.

I'm not sure how purgecss works internally and how feasible it is to detect classes that depend on JS variables.

MrToph commented 5 years ago

Wrong repo, I found what I was looking for in the real one 😄 Sorry