Skip to content

Commit 5a6024a

Browse files
committed
fix(@angular-devkit/build-angular): watch symlink when using preserveSymlinks option
When using the esbuild based builder symlinks are not watched when `preserveSymlinks` is enabled. Closes angular#26585
1 parent 2d4b548 commit 5a6024a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

packages/angular_devkit/build_angular/src/builders/application/build-action.ts

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export async function* runEsBuildBuildAction(
3333
deleteOutputPath?: boolean;
3434
poll?: number;
3535
signal?: AbortSignal;
36+
preserveSymlinks?: boolean;
3637
},
3738
): AsyncIterable<(ExecutionResult['outputWithFiles'] | ExecutionResult['output']) & BuilderOutput> {
3839
const {
@@ -48,6 +49,7 @@ export async function* runEsBuildBuildAction(
4849
projectRoot,
4950
workspaceRoot,
5051
progress,
52+
preserveSymlinks,
5153
} = options;
5254

5355
if (deleteOutputPath && writeToFileSystem) {
@@ -79,6 +81,7 @@ export async function* runEsBuildBuildAction(
7981
watcher = createWatcher({
8082
polling: typeof poll === 'number',
8183
interval: poll,
84+
followSymlinks: preserveSymlinks,
8285
ignored: [
8386
// Ignore the output and cache paths to avoid infinite rebuild cycles
8487
outputPath,

packages/angular_devkit/build_angular/src/builders/application/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export async function* buildApplicationInternal(
7272
},
7373
{
7474
watch: normalizedOptions.watch,
75+
preserveSymlinks: normalizedOptions.preserveSymlinks,
7576
poll: normalizedOptions.poll,
7677
deleteOutputPath: normalizedOptions.deleteOutputPath,
7778
cacheOptions: normalizedOptions.cacheOptions,

packages/angular_devkit/build_angular/src/tools/esbuild/watcher.ts

+2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ export function createWatcher(options?: {
3939
polling?: boolean;
4040
interval?: number;
4141
ignored?: string[];
42+
followSymlinks?: boolean;
4243
}): BuildWatcher {
4344
const watcher = new FSWatcher({
4445
usePolling: options?.polling,
4546
interval: options?.interval,
4647
ignored: options?.ignored,
48+
followSymlinks: options?.followSymlinks,
4749
disableGlobbing: true,
4850
ignoreInitial: true,
4951
});

0 commit comments

Comments
 (0)