nuxt-modules / tailwindcss

Tailwind CSS module for Nuxt
https://tailwindcss.nuxtjs.org
MIT License
1.69k stars 183 forks source link

Obfuscate Tailwind CSS classes #240

Open hmaesta opened 3 years ago

hmaesta commented 3 years ago

For performance proposes, everything that can be made to improve final bundle size is welcome. Even better if automated.

As feature request, would be nice to obfuscate classes on production bundle. Using webpack-obfuscator, for example.

Example

Original code:

# index.vue
<div class="text-gray-500">Hey!</div>

# tailwind.css
.text-gray-500 { color: #888; }

Final code:

# index.html
<div class="a">Hey!</div>

# tailwind.css
.a { color: #888; }
atinux commented 3 years ago

If you want to experiment it, please go ahead :)

I don't know the side effects regarding Tailwindcss purge option.

684efs3 commented 3 years ago

Would love this. Someone mentioned that this could work? I haven't tried it: https://github.com/sndyuk/mangle-css-class-webpack-plugin

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atinux commented 3 years ago

Not stale

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gekkedev commented 2 years ago

not stale

nephix commented 2 years ago

Anyone managed to do this?

gggglglglg commented 2 years ago

Any news? I tried mangle-css-class-webpack-plugin, but it doesn't work for me

thienna commented 1 year ago

Up

estige commented 1 year ago

up

ineshbose commented 1 year ago

Reopened issue but it could take a while to solve this. PR is more than welcome. 🙂

ineshbose commented 10 months ago

Has anyone taken a look at tailwindcss-mangle yet?

JenuelDev commented 7 months ago

is webpack works with vite? or nuxt?