Skip to content

Commit 00aa5bb

Browse files
clydinvikerman
authored andcommitted
fix(@angular-devkit/build-angular): temporarily disable global locale data injection
1 parent 7735516 commit 00aa5bb

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎packages/angular_devkit/build_angular/src/utils/i18n-options.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
162162
`Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`,
163163
);
164164
} else {
165-
desc.dataPath = localeDataPath;
165+
// Temporarily disable pending FW locale data fix
166+
// desc.dataPath = localeDataPath;
166167
}
167168
}
168169
}
@@ -171,6 +172,12 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
171172
if (usedFormats.size > 0) {
172173
buildOptions.i18nFormat = [...usedFormats][0];
173174
}
175+
176+
// If only one locale is specified set the deprecated option to enable the webpack plugin
177+
// transform to register the locale directly in the output bundle.
178+
if (i18n.inlineLocales.size === 1) {
179+
buildOptions.i18nLocale = [...i18n.inlineLocales][0];
180+
}
174181
}
175182

176183
// If inlining store the output in a temporary location to facilitate post-processing

‎tests/legacy-cli/e2e/tests/i18n/ivy-localize-dl.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export default async function () {
3434
await expectFileToMatch(`${outputPath}/main-es2015.js`, lang);
3535

3636
// Verify the locale data is registered using the global files
37-
await expectFileToMatch(`${outputPath}/main-es5.js`, '.ng.common.locales');
38-
await expectFileToMatch(`${outputPath}/main-es2015.js`, '.ng.common.locales');
37+
// await expectFileToMatch(`${outputPath}/main-es5.js`, '.ng.common.locales');
38+
// await expectFileToMatch(`${outputPath}/main-es2015.js`, '.ng.common.locales');
3939

4040
const server = externalServer(outputPath);
4141
try {
@@ -47,9 +47,9 @@ export default async function () {
4747
}
4848

4949
// Verify deprecated locale data registration is not present
50-
await ng('build', '--configuration=fr', '--optimization=false');
51-
await expectToFail(() => expectFileToMatch(`${baseDir}/fr/main-es5.js`, 'registerLocaleData('));
52-
await expectToFail(() => expectFileToMatch(`${baseDir}/fr/main-es2015.js`, 'registerLocaleData('));
50+
// await ng('build', '--configuration=fr', '--optimization=false');
51+
// await expectToFail(() => expectFileToMatch(`${baseDir}/fr/main-es5.js`, 'registerLocaleData('));
52+
// await expectToFail(() => expectFileToMatch(`${baseDir}/fr/main-es2015.js`, 'registerLocaleData('));
5353

5454
// Verify missing translation behaviour.
5555
await appendToFile('src/app/app.component.html', '<p i18n>Other content</p>');

0 commit comments

Comments
 (0)