Kinda tree shaking inspired by tailwindcss purging. #1455
Replies: 3 comments 1 reply
-
I think it's quite possible to do. You would want to remove the You could even potentially do this at runtime using |
Beta Was this translation helpful? Give feedback.
-
It would be possible for sure, but not with the current build/deployment system. Vite virtual modules would be the best way to enable such an option. One thing is just that the core directives are not very large in terms of their unique code, and many are very intertwined to where the largest pieces (like object keys) won't really be removed. But yes, it could get it a bit smaller. |
Beta Was this translation helpful? Give feedback.
-
Related: #3347 |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was thinking about tailwindcss purging approach (pre-jit), and wondering how it might be applicable to Alpine.js.
I wonder if it could be tree shaken by doing a text search on magic properties and directives.
Obviously, you would have the same kind of tradeoffs than tailwind, where you can't do string concatenations and such, but it might allow to reduce the final js payload even more.
I know you already are familiar with tailwindcss, so I expect you already thought about it, but you never know.
Beta Was this translation helpful? Give feedback.
All reactions