Open dmt0 opened 2 years ago
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
Here is a rather new but, thoroughly tested package that I published in order to do away with the frustrations of PurgeCSS: https://www.npmjs.com/package/rmrf-css It can whitelist CSS files based on the argument you provide via the CLI or its exported function. Please read the README for more info
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
content
- didn't work.