How to prevent class duplication in a mono repo that uses tailwindcss for UI and frontend both?

100 views Asked by At

I have a pnpm mono repo project with two packages: ui and frontend. I use the same config (copy/paste) for both packages. When I build the project, the ui package is built first, and its classes are generated. Then, the frontend package is built while using the CSS from the ui package.

The problem is that CSS classes are duplicated at this point. If I use the mb-2 class in both the ui and frontend packages, CSS will be generated for both packages.

How can I prevent this from happening? I want the same classes to be generated only once.

0

There are 0 answers