From TailwindCSS v4, you can manually control automatic source detection using @source. If I now want to map the internal files of a custom UI package so that they are included in the generated CSS, I have to provide such an ugly relative path as a documentation step for users of my UI package:
/* your-app/css/main.css */
@import "tailwindcss";
/* relative path from your main.css to package */
+ @source "./../node_modules/@org/component-library";
It seems I have to resort to this, since for optimization reasons, it ignores all packages in node_modules by default.
How can I provide a nicer alternative instead of the previous approach, like this:
/* your-app/css/main.css */
@import "tailwindcss";
+ @source "@org/component-library";