Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): ignore supported browsers during …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
alan-agius4 authored and dgp1130 committed Jun 23, 2022
1 parent 4d11ace commit ff6d81a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default custom<ApplicationPresetOptions>(() => {
customOptions.forcePresetEnv = true;
// Comparable behavior to tsconfig target of ES5
customOptions.supportedBrowsers = ['IE 9'];
} else if (isJsFile) {
} else if (isJsFile && customOptions.supportedBrowsers?.length) {
// Applications code ES version can be controlled using TypeScript's `target` option.
// However, this doesn't effect libraries and hence we use preset-env to downlevel ES fetaures
// based on the supported browsers in browserlist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ export async function execute(

return partials;
},
// During extraction we don't need specific browser support.
{ supportedBrowsers: undefined },
);

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

0 comments on commit ff6d81a

Please sign in to comment.