From 376e3462d3a2204a412c1d3e4551c20ae6b61aaf Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 29 Jun 2023 07:17:54 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): use absolute watch paths for postcss dependency messages Postcss's directory dependency message can use a glob pattern to reflect that multiple files within a given directory should be watched. When calculated the complete file set, the paths must be absolute to ensure that the watch system correctly invalidates the stylesheet being processed. --- .../tools/esbuild/stylesheets/stylesheet-plugin-factory.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts index 57a942966727..93167c20eaf1 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts @@ -260,7 +260,10 @@ async function compileString( typeof resultMessage['glob'] === 'string' ) { loadResult.watchFiles ??= []; - const dependencies = await glob(resultMessage['glob'], { cwd: resultMessage['dir'] }); + const dependencies = await glob(resultMessage['glob'], { + absolute: true, + cwd: resultMessage['dir'], + }); loadResult.watchFiles.push(...dependencies); } }