how to use purgeCss with mix.combine ?
See original GitHub issueJust read https://murze.be/reducing-the-size-of-a-css-file
Which led me to a new package called purgeCss which is supposed to be a big improvement on purefyCss and can shrink your css files to a tiny size in some cases as described in the article above
Package page: https://github.com/FullHuman/purgecss
this led me to this laravel mix base template: https://gist.github.com/reinink/83058f9af402aa474010844f7f2b1c54
Now the above example works on a single app.css. But in my case I would like to apply purgeCss on a bunch of different files that are being combined through mix.combine like so:
mix.combine([
'resources/assets/css/bootstrap-modals-override.css',
'resources/assets/css/my.animations.css',
'resources/assets/css/my.containers.css',
'resources/assets/css/my.core.css',
'resources/assets/css/my.footer.css',
'resources/assets/css/my.forms.css',
'resources/assets/css/my.header.css',
'resources/assets/css/my.menu.css',
'resources/assets/css/my.plugins.css',
'resources/assets/css/my.responsive.css',
], 'public/dist/css/general.css');
I’ve installed all the dependencies and am setting the plugins like in the template above. But it is having no effect on my combined css files such as general.css above
Would appreciate some help!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (1 by maintainers)

Top Related StackOverflow Question
yea I figured you can run the CLI command after the result of combine()
What I ended up doing is just got rid of my use of combine() and made a file with a bunch of @import instead so I don’t have to use .combine(). I was then able to use postCss()
You can purge CSS with mix.combine(). That command is separate from your webpack build. All it does is combine/concatenate files.