File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/angular/build/src/tools/esbuild Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -671,8 +671,12 @@ function getEsBuildCommonPolyfillsOptions(
671671 // Locale data should go first so that project provided polyfill code can augment if needed.
672672 let needLocaleDataPlugin = false ;
673673 if ( i18nOptions . shouldInline ) {
674- // Remove localize polyfill as this is not needed for build time i18n.
675- polyfills = polyfills . filter ( ( path ) => ! path . startsWith ( '@angular/localize' ) ) ;
674+ const isOptimizedBuild = options . optimizationOptions . scripts ;
675+ if ( isOptimizedBuild ) {
676+ // Remove localize polyfill where script optimizations are enabled
677+ // and therefore, i18n inlining transform has occurred.
678+ polyfills = polyfills . filter ( ( path ) => ! path . startsWith ( '@angular/localize' ) ) ;
679+ }
676680
677681 // Add locale data for all active locales
678682 // TODO: Inject each individually within the inlining process itself
You can’t perform that action at this time.
0 commit comments