purgecss
purgecss copied to clipboard
Ability to whitelist whole CSS files
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.
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?
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.
Bump
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.
I saw no negative feedback, so ... bump 🤷
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.
Not stale
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.
No workarounds so far. This package is unusable to me unfortunately.
No workarounds so far. This package is unusable to me unfortunately.
@dmt0 have you used any other package for the same functionality
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'; ...
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.
bump