Open nolafs opened 2 months ago
I found the solution. I am using Prismic in my project. Prismic does not support monorepos. To make the Slice Machine work, I had to install it inside the application, which creates a node_modules folder. The createGlobPatternsForDependencies helper does not exclude the nested node_modules folder, and Tailwind will process this folder. This is the cause of the 20-minute build time. I came up with a simple hack.
const content = [...createGlobPatternsForDependencies(__dirname)];
const index = content.findIndex((item) => item.includes('apps/kids-guitar-dojo'));
content[index] = content[index].replace('apps/kids-guitar-dojo/', 'apps/kids-guitar-dojo/(!node_modules)');
Link to the code that reproduces this issue
https://github.com/nolafs/Rocket-house-productions/tree/development
To Reproduce
Current vs. Expected behavior
It is taking around 22 min to compile the project. When removing Tailwind imports such as base, compile time is normal. Removing NX createGlobPatternsForDependencies(__dirname) and importing each library manually seems to fix it as well.
Here is the output of createGlobPatternsForDependencies
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I am running the lastest versions