Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

920
Visualizações
Tailwind purge with Nx, no ProjectGraph error

The documentation here: https://nx.dev/l/r/guides/using-tailwind-css-in-react#introducing-nx-utility-for-better-tailwind-purging suggests to use createGlobPatternsForDependencies(__dirname) for ease of maintenance.

I am using this from '@nrwl/angular/tailwind', not '@nrwl/react/tailwind'.

When I use this and trigger a build of my app, I get the following errors:

[createGlobPatternsForDependencies] WARNING: There was no ProjectGraph available to read from, returning an empty array of glob patterns

Q: How can I resolve this?

I can run nx dep-graph and the dependency graph generates fine.

EDIT: I debugged this, and __dirname documentation says workspace relative directory path that will be used to infer the parent project and dependencies but then it fails later on line 20 of generate-globs.js because filenameRelativeToWorkspaceRoot is the '', i.e. its trying to find a project name but __dirname is the workspace name itself?

so

purge: createGlobPatternsForDependencies(join(__dirname, 'apps/simple-app')),

doesn't give the ProjectGraph error but

purge: createGlobPatternsForDependencies(__dirname), does

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I also posted on Github which raised the issue of the Nx documentation being based around React.

Since I posed this question, a blog post has been written: https://blog.nrwl.io/set-up-tailwind-css-with-angular-in-an-nx-workspace-6f039a0f4479

and documentation is on the Nx web site: https://nx.dev/guides/using-tailwind-css-with-angular-projects

but the key learning for this is have a separate Tailwind config file per app.

you can have a preset with shared Tailwind config and consume that, but the createGlobPatternsForDependencies expects to be per app, so then the __dirname being the project name makes a whole lot more sense...

If at that point you still get [createGlobPatternsForDependencies] WARNING: There was no ProjectGraph available to read from, returning an empty array of glob patterns then there is possibly a circular dependency preventing the code from executing, its possible to debug the tailwind.js file in node_modules/@nrwl/angular/ to see.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda