spatie / laravel-mix-purgecss

Zero-config Purgecss for Laravel Mix
https://spatie.be/en/opensource
MIT License
874 stars 38 forks source link

purgecss messes up css when minified #72

Closed MacedoRAC closed 4 years ago

MacedoRAC commented 5 years ago

I'm using PurgeCss with Laravel Mix and when compiled to development everything works fine however when it's compiled to production seems that some classes that are being used on the HTML or Vue components are still being removed from the compiled file.

I'm using the latest version 4.1.0.

This problem was also pointed out on laravel mix github page

Also it's the second project this is happening to me, so for now I'm just commenting it out.

If you need more information/details please let me know.

rubenmarques-dev commented 5 years ago

+1

GrameJunior commented 5 years ago

+1

realtebo commented 5 years ago

Hi !

Thanks for the plugin, but we have the same problem.

We're using in a laravel 5.8.* project, with sass and vue.

I ask you: could the source of this problem be related to usage scoped sass into vue SFC (single file components) ?

ivandokov commented 4 years ago

PurgeCSS is not enabled during development build. This is why you do not have any issues. https://github.com/spatie/laravel-mix-purgecss/blob/master/src/index.js#L23

Maybe the styles that you are missing are not found by PurgeCSS in the html and then stripped out. Maybe you need to whitelist third party classes such as plugin related ones (e.g. PrismJS, etc).

MacedoRAC commented 4 years ago

PurgeCSS is not enabled during development build. This is why you do not have any issues. https://github.com/spatie/laravel-mix-purgecss/blob/master/src/index.js#L23

Maybe the styles that you are missing are not found by PurgeCSS in the html and then stripped out. Maybe you need to whitelist third party classes such as plugin related ones (e.g. PrismJS, etc).

That was exactly the problem. Some of the classes were add to the DOM dynamically, so PurgeCSS deletes the styles. Thanks.