diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts index 4d8dcbb46db6..ff9244e4a8f2 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts @@ -16,7 +16,7 @@ import type { PluginBuild, } from 'esbuild'; import assert from 'node:assert'; -import { realpath } from 'node:fs/promises'; +import { realpathSync } from 'node:fs'; import * as path from 'node:path'; import { maxWorkers } from '../../../utils/environment-options'; import { JavaScriptTransformer } from '../javascript-transformer'; @@ -61,8 +61,11 @@ export function createCompilerPlugin( if (!preserveSymlinks) { // Use the real path of the tsconfig if not preserving symlinks. // This ensures the TS source file paths are based on the real path of the configuration. + // NOTE: promises.realpath should not be used here since it uses realpath.native which + // can cause case conversion and other undesirable behavior on Windows systems. + // ref: https://github.com/nodejs/node/issues/7726 try { - tsconfigPath = await realpath(tsconfigPath); + tsconfigPath = realpathSync(tsconfigPath); } catch {} }