renatomarinho / laravel-page-speed

Package to optimize your site automatically which results in a 35%+ optimization
MIT License
2.4k stars 275 forks source link

InlineCss middleware breaks Alpine JS #154

Open amiranagram opened 3 years ago

amiranagram commented 3 years ago

Detailed description

From my understanding after giving it a quick look, this middleware combines duplicate attributes into one, for a single tag. Well this also combines Alpine's x-bind:attribute which is undesired when working with Alpine.

Context

Pretty self explanatory, anyone using Alpine JS in their project, or similar packages that utilize custom attributes will have this issue.

Possible implementation

For starter we could ignore tags that contain :. I don't know any other packages that do the same job as Alpine JS does, but these days Alpine JS is goto for Laravel developers and maybe a fix for Alpine only would be enough.

Your environment

To reproduce check out this pen and copy the code inside a Laravel project utilizing the InlineCss middleware. Also check out my issue in Alpine JS repo to see the full context.