Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spyrosjeva's avatar

Problem with purifyCss

Hello there guys, im trying make purifycss work without success for some reason.Here the code

mix.styles('website/assets/css/test.css', 'website/assets/output-test.css').options({

    purifyCss: {
        purifyOptions: {
            info: true,
            rejected: true,
            minify: true
        },
        paths: ['resources/views/frontend/index.blade.php'],
        verbose:true
    }

}); 

The test.css file has only one class inside which is not even used on index so i was expecting an empty file to be generated but in the new file the class still exists.

Here is the outpoot when i run npm run dev

> @ dev C:\wamp64\www\blablatoys
> npm run development


>@ development C:\wamp64\www\blablatoys
>cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 92% recordingAssets to purify:                                                                                                                                                                                                                         95% emitting
                  
 DONE  Compiled successfully in 88ms                                                                                                                                                                                                                         13:27:29

      Asset      Size  Chunks             Chunk Names
                  mix.js   2.59 kB       0  [emitted]  mix
\website\assets\test.css  29 bytes          [emitted]  

0 likes
0 replies

Please or to participate in this conversation.