Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): only remove localize polyfill if …
Browse files Browse the repository at this point in the history
…in AOT mode

Fixes: #16890
(cherry picked from commit 3c771d1)
  • Loading branch information
clydin authored and dgp1130 committed Feb 11, 2020
1 parent 7f0b9b6 commit ad5e1bb
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ export async function generateI18nBrowserWebpackConfigFromContext(
const config = result.config;

if (i18n.shouldInline) {
// Remove localize "polyfill"
if (!config.resolve) {
config.resolve = {};
// Remove localize "polyfill" if in AOT mode
if (buildOptions.aot) {
if (!config.resolve) {
config.resolve = {};
}
if (!config.resolve.alias) {
config.resolve.alias = {};
}
config.resolve.alias['@angular/localize/init'] = require.resolve('./empty.js');
}
if (!config.resolve.alias) {
config.resolve.alias = {};
}
config.resolve.alias['@angular/localize/init'] = require.resolve('./empty.js');

// Update file hashes to include translation file content
const i18nHash = Object.values(i18n.locales).reduce(
Expand Down

0 comments on commit ad5e1bb

Please sign in to comment.