From b56ab07980c5d990606ddb1e298fc1c4ecf8a2a8 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. (cherry picked from commit 376e3462d3a2204a412c1d3e4551c20ae6b61aaf) --- .../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 69295c88c547..372805be0253 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 @@ -283,7 +283,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); } }