I’ve modified a gulpfile I’ve found on github and it has an “after” gulp task which I need to run manually at this point, but it does the job.
The Purge CSS task is not ideal, it removes some classes it shouldn’t, you might need to whitelist some CSS classes which get removed in the purging process: https://purgecss.com/whitelisting.html
I tried to add after_build instructions to make the purging process run automatically, but I didn’t find a way to invoke the gulp task from the after_build hook, invoking the command via thor.run didn’t work for me.