How to get tailwind working across modules within a NX workspace?

This issue has been tracked since 2022-11-05.

I'm trying to get tailwind working for my ux library module as well, but so far only components of the actual application are processed.

At first I was relying on "createGlobPatternsForDependencies", but this always returns an empty array for whatever reason.
So I also tried to reference the library module directly, but this also won't work.

This is my tailwind.config.js

const {createGlobPatternsForDependencies} = require('@nrwl/react/tailwind');
const {join} = require('path')
module.exports = {
  content: [
    join(__dirname, 'src/**/*!(*.stories|*.spec).{ts,tsx,html,js,jsx,ts,tsx,vue}'),

    // returns empty array
    ...createGlobPatternsForDependencies(__dirname),
 
    // direct reference has no effect either
    `./libs/general/base/src/molecules/*.{vue,js}`,

    `components/**/*.{vue,js}`,
    `layouts/**/*.vue`,
    `pages/**/*.vue`,
    `composables/**/*.{js,ts}`,
    `plugins/**/*.{js,ts}`,
    `App.{js,ts,vue}`,
    `app.{js,ts,vue}`
  ],

What am I missing to get it working for the library module as well?

this-gavagai wrote this answer on 2022-11-11

I'm facing this issue with a Vue plugin. For what it's worth, I had this same problem when installing tailwind manually too, so I don't think it's specific to this module.

I was able to get it to work by adding the path to my tailwindcss.config.ts file's content attribute:

`content: [
    './node_modules/MODULE_NAME/**/*.vue'
 ],

This is inefficient and inelegant, however, so I hope a better way is possible.

More Details About Repo
Owner Name nuxt-modules
Repo Name tailwindcss
Full Name nuxt-modules/tailwindcss
Language TypeScript
Created Date 2019-04-04
Updated Date 2023-03-29
Star Count 1285
Watcher Count 12
Fork Count 157
Issue Count 57

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date