purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

Access the filename in extractor function

Open crisz opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. I'm implementing an extractor for Angular CSS, and I'd like to access the filename in the extractor function in order to prevent purging unwanted classes. As an example, a selector like component-name > .foo is purged, but accessing the component name I could transform the template in <component-name><div class="foo"></div></component-name> and preventing it from being purged.

Describe the solution you'd like I'd like the ExtractorFunction type to become from (content: string) => ExtractorResult; to (content: string, filename: string) => ExtractorResult;

Describe alternatives you've considered I didn't find any alternative to this problem

crisz avatar Jul 22 '22 17:07 crisz