Developmint / nuxt-purgecss

Drop superfluous CSS! A neat PurgeCSS wrapper for Nuxt.js
MIT License
480 stars 19 forks source link

Support for special comments #48

Closed gendalf closed 2 years ago

gendalf commented 5 years ago

Is there are any way to keep analyze special whitelist comments before it will strip?

https://github.com/FullHuman/purgecss-docs/blob/master/whitelisting.md

/ purgecss ignore /

/ purgecss start ignore /

manniL commented 5 years ago

This module is using purgecss under the hood, so it should be already possible :relaxed:

andrewrynhard commented 5 years ago

This doesn't seem to be working as expected. I added /* purgecss start ignore */ to the top of main.css and /* purgecss end ignore */ to the bottom, but the CSS still never makes it in.

danielkellyio commented 4 years ago

I'm having the same issue. Css inside of a / purgecss start ignore / and / purgecss end ignore / are being purged from production bundle. (When I use npm run dev the styles are good, but npm run generate results in those styles being missing). Not sure if this is an issue with this moule, nuxt, or some other module I'm using (like maybe the comments are being stripped before it ever gets to purge)??

avblink commented 3 years ago

Just confirming, this is still the case

avblink commented 3 years ago

In webpack we need to add ! to the comment:

/*! purgecss start ignore */
...
/*! purgecss end ignore */

But it only works with these comments. not others.

manniL commented 2 years ago

Resolved via linked PR