How to set up Tailwind to parse library components in an Angular Monorepo? #18313
-
I'm trying to get Tailwind to discover classes referenced in components used in a shared library in an Angular Monorepo with multiple applications. Tailwind discovers all of the classes referenced directly in the apps' source files, but misses everything referenced in the library. I put together a demo of the issue. https://github.com/DarthRainbows/tailwind-angular-monorepo Any guidance you could provide would be most welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Try explicitly telling Tailwind to scan your library code using the diff --git a/apps/app1/src/styles.css b/apps/app1/src/styles.css
index 2b9fc63..b71c993 100644
--- a/apps/app1/src/styles.css
+++ b/apps/app1/src/styles.css
@@ -1,5 +1,7 @@
@import 'tailwindcss';
+@source "../../../libs";
+
html,
body {
display: block;
diff --git a/apps/app2/src/styles.css b/apps/app2/src/styles.css
index bce6cf0..9290f5d 100644
--- a/apps/app2/src/styles.css
+++ b/apps/app2/src/styles.css
@@ -1,5 +1,7 @@
@import 'tailwindcss';
+@source "../../../libs";
+
html,
body {
display: block;
|
Beta Was this translation helpful? Give feedback.
-
Thanks, that worked. |
Beta Was this translation helpful? Give feedback.
Try explicitly telling Tailwind to scan your library code using the
@source
directive: