Closed geoff-maddock closed 2 years ago
similar problem. It breaks my react code.
Generally Lightboxes, Sliders etc. are adding or removing classes based on the event. For example: When you have a lightbox on your page you will add the class "show" to your lightbox which will show the element. If PurgeCSS cleaned everything up and couldn't find any uses (because its added by javascript) the class "show" is not defined in your minified css version.
SOLUTION: Try to use the "safelist" feature and figure out which classes will be added or removed by lightbox and list them there. After that they won't get removed.
mix.sass('resources/sass/app.scss', 'public/css') .purgeCss({ safelist: ['fade', 'show', 'active', 'carousel-item-end', 'slide', 'carousel-item-prev', 'carousel-item-next', 'carousel-item- start'] });
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
I'm using purgeCss 6.0.0 in webpack with my laravel 8 application. I found that for some reason my lightbox and popper code breaks when I use purgeCSS. Oddly, only in prod, not in dev.
app.scss:
webpack.mix.js:
With purgeCss enabled, my app.css and dark.css are minimized, but the lightbox and popper code breaks. When I remove or disable it, those files grow, but the lightbox and popper code is not broken. Any suggestions on when to change with the config?