google / postcss-rename

Replace class names based on a customizable renaming scheme.
Apache License 2.0
125 stars 18 forks source link

Support multiple CSS files #63

Closed RodrigoTomeES closed 1 year ago

RodrigoTomeES commented 1 year ago

Hi,

I am currently working on implementing an integration of this package for Astro. I have noticed that the plugin loses the context of the previous CSS Class Map. This issue arises when there are multiple CSS files, as it can lead to errors with duplicate keys for different classes when iterating through minified classes.

I wanted to inquire if there are any plans to modify this behavior. Currently, I have a version that supports only one CSS file, but I would like to make it compatible with multiple CSS files. This would involve ensuring that the context of the previous keys is maintained while iterating through the minified classes.

Thank you.

nex3 commented 1 year ago

PostCSS's plugin API doesn't have any built-in support for tracking information across multiple files. I think the best solution here is probably for you as the plugin invoker to use its customization API to track that information in whatever way works best for you.