Skip to content

Conversation

@JGhignatti
Copy link
Contributor

Closes #1021

In Angular CLI's v21.0.0 release, this commit was merge, which changes how the PostCSS plugins are located and loaded.

resolve PostCSS plugins relative to config file

Because of that, and because the projectRoot was just path.dirname(tsConfigPath), an error happened when trying to find the TailwindCSS plugin.

Angular has a getProjectRootPaths(workspaceRoot, projectMetadata) utility function, but it's not exposed outside the lib. I was able to find inspiration here.

With this approach, both workspaceRoot and projectRoot are absolute paths. Using with generateSearchDirectories makes the PostCSS work and simplifies the TailwindCSS logic a bit, being able to drop manually having to create the path.

Please feel free to comment.

With proper project root path, the `loadPostcssConfiguration` function works as expected after the v21 update.
Also, it's possible to simplify the `getTailwindConfig` implemntation, it will still build the correct relative path.
@Aukevanoost
Copy link
Collaborator

Seems fine to me! Thanks again for your time and efforts!

@Aukevanoost Aukevanoost merged commit 5a549cf into angular-architects:main Dec 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: ERR_INVALID_ARG_VALUE when building federation artifacts with Native Federation and latest Angular + Tailwind V4

2 participants