From 519e01952a9ebb79cadb286170d33279a7fb4f2a Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:54:52 -0400 Subject: [PATCH] refactor(@angular/build): lazy load sourcemap remapping in i18n inliner worker Previously, `@ampproject/remapping` was statically imported at the top level of `i18n-inliner-worker.ts`, eagerly pulling in 5 packages (`@ampproject/remapping` and 4 sub-dependencies) upon worker initialization. In typical workflows or when sourcemaps are not requested for inlining, remapping is never executed. This changes the import of `@ampproject/remapping` to be dynamic so that it is only loaded when a file actually requires sourcemap remapping. --- packages/angular/build/src/tools/i18n/i18n-inliner-worker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/angular/build/src/tools/i18n/i18n-inliner-worker.ts b/packages/angular/build/src/tools/i18n/i18n-inliner-worker.ts index f0bd270dc56c..66eaf23ca974 100644 --- a/packages/angular/build/src/tools/i18n/i18n-inliner-worker.ts +++ b/packages/angular/build/src/tools/i18n/i18n-inliner-worker.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import remapping, { type DecodedSourceMap, type SourceMapInput } from '@ampproject/remapping'; +import { type DecodedSourceMap, type SourceMapInput } from '@ampproject/remapping'; import { type ɵParsedTranslation, ɵisMissingTranslationError, @@ -156,6 +156,8 @@ const deserializedTranslations = new Map null); }