Skip to content

Conversation

alan-agius4
Copy link
Collaborator

Previously, PostCSS plugins were resolved from the location of @angular/build. This caused issues when the PostCSS configuration file was located in a subdirectory and used plugins not hoisted to the root node_modules, as plugins would not be found.

This change updates the PostCSS configuration loading to resolve plugins relative to the directory containing the PostCSS configuration file. This ensures that plugins are correctly located regardless of the configuration files location.

@alan-agius4 alan-agius4 requested a review from clydin September 4, 2025 10:11
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 4, 2025
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Sep 4, 2025
Previously, PostCSS plugins were resolved from the location of `@angular/build`. This caused issues when the PostCSS configuration file was located in a subdirectory and used plugins not hoisted to the root `node_modules`, as plugins would not be found.

This change updates the PostCSS configuration loading to resolve plugins relative to the directory containing the PostCSS configuration file. This ensures that plugins are correctly located regardless of the configuration files location.
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 4, 2025
@alan-agius4 alan-agius4 merged commit 26127bd into angular:main Sep 4, 2025
78 of 82 checks passed
@alan-agius4 alan-agius4 deleted the tailwinds-css branch September 4, 2025 15:10
for (const [pluginName, pluginOptions] of options.postcssConfiguration.plugins) {
const { default: plugin } = await import(pluginName);

const postCssPluginRequire = createRequire(dirname(configPath) + '/');
Copy link

@th0r th0r Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alan-agius4 this change brakes importing of plugins that are ES modules as in this case the plugin below won't be a function, but an {default: <function>, __esModule: true} object and it won't pass a check below.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants