From 97716969c243d65e385dcd78f5035d2c13f0258b Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 5 Dec 2022 12:14:00 -0500 Subject: [PATCH] fix(@angular-devkit/build-angular): default preserve symlinks to Node.js value for esbuild When using the experimental esbuild-based browser application builder, the `preserveSymlinks` option will now default to the value of the Node.js `--preserve-symlinks` argument. This removes the need to manually specify the option in two places if executing the build manually with Node.js or via the `NODE_OPTIONS` environment variable. This behavior mimics that of the default Webpack-based builder. --- .../build_angular/src/builders/browser-esbuild/options.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/options.ts b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/options.ts index 7a36796a95a2..649b970a048c 100644 --- a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/options.ts +++ b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/options.ts @@ -152,7 +152,8 @@ export async function normalizeOptions( crossOrigin, externalDependencies, poll, - preserveSymlinks, + // If not explicitly set, default to the Node.js process argument + preserveSymlinks: preserveSymlinks ?? process.execArgv.includes('--preserve-symlinks'), stylePreprocessorOptions, subresourceIntegrity, verbose,