Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for special comments #48

Closed
gendalf opened this issue Jun 8, 2019 · 6 comments
Closed

Support for special comments #48

gendalf opened this issue Jun 8, 2019 · 6 comments

Comments

@gendalf
Copy link

gendalf commented Jun 8, 2019

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
Copy link
Member

manniL commented Jun 10, 2019

This module is using purgecss under the hood, so it should be already possible ☺️

@manniL manniL closed this as completed Jun 10, 2019
@andrewrynhard
Copy link

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
Copy link

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
Copy link

avblink commented Mar 11, 2021

Just confirming, this is still the case

@manniL manniL reopened this Mar 11, 2021
@avblink
Copy link

avblink commented Mar 11, 2021

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
Copy link
Member

manniL commented Sep 30, 2022

Resolved via linked PR

@manniL manniL closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@manniL @gendalf @andrewrynhard @danielkellyio @avblink and others