This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


Hi guys. I just wonder if anyone is using this nice package laravel-mix-purgecss in October theme. I am creating one using tailwindcss and build with laravel-mix. I read the docs and configure the webpack.mix.js as following:

mix.postCss('./themes/acme/assets/css/tailwind.css', 'dist/css', [
    enabled: mix.inProduction(),
    folders: ['./themes/acme/pages', './themes/acme/partials'],
    extensions: ['htm', 'js', 'html'],

But it seems not working: the bundled css size is the same without purgecss. Any advices?

The Bakerdev
The Bakerdev

For some reason, I also can't make laravel-mix-purgecss package inside an October theme. Instead I've used @fullhuman/postcss-purgecss and used it on mix's postcss option.

Here's a sample config:

const mix = require('laravel-mix');

const purgeCss = require('@fullhuman/postcss-purgecss');

let postCssPlugins = [

if (mix.inProduction()) {
        content: [
        defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
.postCss('assets/src/css/style.css', 'assets/dist/css', postCssPlugins);

I'm using a similar config on a theme I've created using Tailwindcss and Purgecss. Hope this helps.


I have switched to gulp 4. Thanks to its plugin gulp-purgecss, everything is working now. gulp gives me more flexibility by assigning a task to every point in my frontend workflow. Here is my gulpfile.js code for purgecss.

const { task, src, dest } = require('gulp'),
        purgecss = require('gulp-purgecss'),
        pipeline = require('readable-stream').pipeline;
const cssDist = 'themes/acme/assets/css';
const dist = 'themes/acme/assets/dist/css';
const twigFiles = 'themes/**/*.htm';

task('purgecss', function () {
    return pipeline(
        src(cssDist + '/*.css'),
            content: [twigFiles],
            defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []

The config options of purgecss is somewhat similar to yours, @The Bakerdev. Thank you.

Last updated


hi bonnis26 just lookin at gulp 4 myself but looking at your file not sure how you run the task any help as I an just learning how to intergate gulp into my project

1-4 of 4

You cannot edit posts or make replies: the forum has moved to