Skip to content

Commit f088569

Browse files
committed
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 (cherry picked from commit ccc5982)
1 parent 542973a commit f088569

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/build/src/tools/esbuild/application-code-bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ function getEsBuildCommonPolyfillsOptions(
686686
needLocaleDataPlugin = true;
687687
}
688688
if (needLocaleDataPlugin) {
689-
buildOptions.plugins.push(createAngularLocaleDataPlugin());
689+
buildOptions.plugins.unshift(createAngularLocaleDataPlugin());
690690
}
691691

692692
if (polyfills.length === 0) {

0 commit comments

Comments
 (0)