NextJS/React: Is there way/tool to combine classes into single obfuscated after build? #15541
Answered
by
dvzrd
fakeman2332
asked this question in
Help
-
I want to combine all classes into obfuscated like |
Beta Was this translation helpful? Give feedback.
Answered by
dvzrd
Jan 5, 2025
Replies: 2 comments 4 replies
-
I've tried https://github.com/soranoo/next-css-obfuscator, but it obfuscating every class and not merge them after all |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can define a custom class in your CSS file and include all these Tailwind classes: .asdfg123{ |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have scoped styles using css/sass modules you can achieve this pretty easily just by enabling style modules during your build process using postcss (or a similar build tool) - this would require you to have a separate stylesheet and you will need to create classes to apply those utilities to (which you probably don't want). If you're talking about inline html classes then you will need to create your own build script that processes the tailwind utility classes into unique class ids. You won't get this out the box with next and tailwind, need to go low level with your build scripts and use a combination of build tools.
I guess I would have to ask what reason do you have for doing th…