From 3bb1fe5391be3cff88214919699e741c2806902e Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Wed, 29 Oct 2025 17:06:56 +0000 Subject: [PATCH] fix(@angular/build): ensure locale data plugin runs before other plugins The Angular locale data plugin is responsible for resolving imports. In some cases, other plugins would attempt to resolve these imports first, leading to a 'Failed to resolve import' error. By ensuring that the Angular locale data plugin is prepended to the esbuild plugin list, we guarantee that it runs before other plugins, allowing it to correctly resolve the locale data imports. Closes #31579 --- .../angular/build/src/tools/esbuild/application-code-bundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/build/src/tools/esbuild/application-code-bundle.ts b/packages/angular/build/src/tools/esbuild/application-code-bundle.ts index b17029f6c5e1..51d3702887f7 100644 --- a/packages/angular/build/src/tools/esbuild/application-code-bundle.ts +++ b/packages/angular/build/src/tools/esbuild/application-code-bundle.ts @@ -686,7 +686,7 @@ function getEsBuildCommonPolyfillsOptions( needLocaleDataPlugin = true; } if (needLocaleDataPlugin) { - buildOptions.plugins.push(createAngularLocaleDataPlugin()); + buildOptions.plugins.unshift(createAngularLocaleDataPlugin()); } if (polyfills.length === 0) {