Skip to content

Commit ff6d81a

Browse files
alan-agius4dgp1130
authored andcommitted
fix(@angular-devkit/build-angular): ignore supported browsers during i18n extraction
Since extraction doesn't work on the browser we can ignore the `supportedBrowsers` configuration during message extraction. Closes #23420 (cherry picked from commit 1fc7d4f)
1 parent 4d11ace commit ff6d81a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/angular_devkit/build_angular/src/babel/webpack-loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default custom<ApplicationPresetOptions>(() => {
125125
customOptions.forcePresetEnv = true;
126126
// Comparable behavior to tsconfig target of ES5
127127
customOptions.supportedBrowsers = ['IE 9'];
128-
} else if (isJsFile) {
128+
} else if (isJsFile && customOptions.supportedBrowsers?.length) {
129129
// Applications code ES version can be controlled using TypeScript's `target` option.
130130
// However, this doesn't effect libraries and hence we use preset-env to downlevel ES fetaures
131131
// based on the supported browsers in browserlist.

packages/angular_devkit/build_angular/src/builders/extract-i18n/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ export async function execute(
233233

234234
return partials;
235235
},
236+
// During extraction we don't need specific browser support.
237+
{ supportedBrowsers: undefined },
236238
);
237239

238240
// All the localize usages are setup to first try the ESM entry point then fallback to the deep imports.

0 commit comments

Comments
 (0)