dxgx/blade-tailwind-extract
Laravel package that shrinks Livewire payloads by extracting long Tailwind class strings from Blade/Livewire into short hashed class names and a generated @apply CSS file. Supports class="", @class/->class arrays, dev inject vs prod extract, and collision-safe hashing.
Adopt if:
Look elsewhere if:
@layer or a custom build process).For Executives: "This package automates the optimization of Livewire component performance by reducing the size of data transferred between the server and client. For apps with heavy Livewire usage—like dashboards or admin panels—this can cut payload sizes by 30-50%, directly improving responsiveness and user experience. It’s a low-risk, high-reward tool that requires no architectural changes, just a one-time setup. Think of it as ‘automated code golf’ for your frontend: smaller payloads, faster updates, and happier users."
For Engineering Teams:
"If you’re tired of bloated Livewire wire transfers from long Tailwind class strings, this package replaces them with compact CSS classes during build time. It supports all major Blade/Livewire/Alpine patterns, handles edge cases (like reserved Tailwind classes), and integrates seamlessly into your Laravel workflow. The wrap command auto-detects reusable class lists, while extract and restore commands let you toggle between development (readable) and production (optimized) modes. No more manual refactoring—just run a CLI command and let it handle the heavy lifting. Perfect for teams prioritizing performance without sacrificing Tailwind’s flexibility."
For Developers:
*"This is like Tailwind’s @apply on steroids for Livewire. Instead of manually extracting classes into CSS, you can:
__card-wrapper__).TW-a40f-card-wrapper) with @apply rules.class="", wire:class, :class, @class, etc.), skips reserved Tailwind classes, and even deduplicates identical lists across files. The CLI commands are intuitive, and the package plays nice with your existing Tailwind setup. Try it on a Livewire-heavy component—you’ll see the payload shrink instantly."*How can I help you explore Laravel packages today?