Is there a way to configure Tailwind to ignore components that are cut by tree-shaking? #18317
Unanswered
DarthRainbows
asked this question in
Help
Replies: 2 comments
-
You could ignore paths of components that are unused or ignore specific class names. There is no way to configure Tailwind to do this automatically. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I wondered is there a way to configure such that the compiled HTML / JS file is build first and Tailwind plugin look into them for the classname. I have tried to build with source pointing to the "dist" folder and it works; but I am no expert to automate it in Vite or Postcss. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Following up on my last question (#18313), I notice that all library components that are not used by app app still have their Tailwind classes generated as if they were used. The Angular tree-shaking is working to ensure that these components are not included in the build output, as expected, it's just the Tailwind classes that are being included. Is there a way to address this?
Example: https://github.com/DarthRainbows/tailwind-angular-monorepo/tree/tree-shaking. Run
npx nx build app1
.<lib1-blue-background />
is not used byapp1
, and is tree-shaken from the compiled output, but the CSS class forbg-blue-500
is still created, even though no other components use that class.Beta Was this translation helpful? Give feedback.
All reactions