GoogleChromeLabs / critters

🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
https://npm.im/critters-webpack-plugin
Apache License 2.0
3.42k stars 108 forks source link

Parse include/exclude markers with @preserve or /*! hints #134

Open xumepadismal opened 1 year ago

xumepadismal commented 1 year ago

Some bundlers (in my case it's Angular CLI) minifies CSS before running critters. Therefore, any /* critters:exclude */ comments got stripped.

However, it's possible to preserve them using /*! critters:exclude */ or /* critters:exclude @preserve */ hints but in this case these markers are ignored by critters.

Would it be possible to implement a bit smarter parse logic to support these cases?

Thanks