DEV Community

Cristian N
Cristian N

Posted on • Originally published at cristiannebunu.com

5 2

Clean up unused CSS with PurgeCSS on Laravel and WordPress

I read recently the article How I dropped 250KB of dead CSS weight with PurgeCSS and thought I should put out my setup for this situation. I use Laravel Mix for both Laravel development and also for my WordPress work. My main stack includes Vue.js and TailwindCSS, so these snippets will do just fine when working with these frameworks. Beyond that, I can’t make any promises.

But as an endorsement to PurgeCSS, I will tell you, that for the past few projects I have done in WordPress, I managed to get my CSS file down to around 50 kB minified.

My Laravel config file looks like this

laravel config

My WordPress config file looks like this

wordpress config

Originally published at cristiannebunu.com on July 25, 2018

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay