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

Ability to whitelist whole CSS files #919

Open
dmt0 opened this issue Jun 1, 2022 · 13 comments
Open

Ability to whitelist whole CSS files #919

dmt0 opened this issue Jun 1, 2022 · 13 comments

Comments

@dmt0
Copy link

dmt0 commented Jun 1, 2022

Is your feature request related to a problem? Please describe.
I'm importing an NPM module that includes a CSS file. A lot of the classes in that file are caught by PurgeCSS.

Describe the solution you'd like
A configuration option to whitelist entire files by path.

Describe alternatives you've considered

  • Fishing out classes one by one.
  • Adding all JS files from the NPM module to content - didn't work.
@dmt0 dmt0 changed the title Ability to whitelist files Ability to whitelist whole CSS files Jun 1, 2022
@aleesaan
Copy link

I was also looking for this! In my case the issue was that I want to exclude all Datatables (+ plugins) styles from the purging, as it would be impossible to manually find and safelist them one by one.

I also tried wrapping the imports like:

/* purgecss start ignore */
@import "~datatables.net/...";
/* purgecss end ignore */ 

But that also doesn't work 😢 Anybody has suggestions?

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Sep 9, 2022
@dmt0

This comment was marked as off-topic.

@github-actions github-actions bot removed the Stale label Sep 10, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Dec 9, 2022
@dmt0

This comment was marked as off-topic.

@github-actions github-actions bot removed the Stale label Dec 10, 2022
@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 10, 2023
@aleesaan
Copy link

Not stale

@github-actions github-actions bot removed the Stale label Mar 11, 2023
@anoop0567
Copy link

Hi @dmt0 and @aleesaan , have you any workaround solution for this I'm using next.js module css and don't want to remove them at all.

@dmt0
Copy link
Author

dmt0 commented May 3, 2023

No workarounds so far. This package is unusable to me unfortunately.

@anoop0567
Copy link

No workarounds so far. This package is unusable to me unfortunately.

@dmt0 have you used any other package for the same functionality

@aaronhernan
Copy link

I made it work, with Laravel 10 + Vite 4.4 + PurgeCss, with a workaround...
First...
/* purgecss start ignore */
didnt work at all, so i have to use
/*! purgecss start ignore */
Second, it didnt work for me on full @import
/*! purgecss start ignore */ @import 'datatables.net-dt/css/jquery.dataTables.css'; ...
so... i copied the .css file to my resource dir, and include the start/stop inside the .css file, and then just import it
@import 'jquery.dataTables-PurgeIgnored.css'; ...

Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 29, 2024
@dmt0
Copy link
Author

dmt0 commented Jan 29, 2024

bump

@github-actions github-actions bot removed the Stale label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants