@@ -39,6 +39,7 @@ export default async function() {
3939 const appArchitect = appProject . architect || appProject . targets ;
4040 const serveConfigs = appArchitect [ 'serve' ] . configurations ;
4141 const e2eConfigs = appArchitect [ 'e2e' ] . configurations ;
42+ const buildConfigs = appArchitect [ 'build' ] . configurations ;
4243
4344 // Make default builds prod.
4445 appArchitect [ 'build' ] . options . optimization = true ;
@@ -63,6 +64,8 @@ export default async function() {
6364 } else {
6465 i18n . locales [ lang ] = `src/locale/messages.${ lang } .xlf` ;
6566 }
67+
68+ buildConfigs [ lang ] = { localize : [ lang ] } ;
6669 serveConfigs [ lang ] = { browserTarget : `test-project:build:${ lang } ` } ;
6770 e2eConfigs [ lang ] = {
6871 specs : [ `./src/app.${ lang } .e2e-spec.ts` ] ,
@@ -142,6 +145,11 @@ export default async function() {
142145 }
143146 }
144147
148+ // Verify locale data registration (currently only for single locale builds)
149+ await ng ( 'build' , '--optimization' , 'false' , '-c' , 'fr' , '--i18n-missing-translation' , 'error' ) ;
150+ await expectFileToMatch ( `${ baseDir } /fr/main-es5.js` , 'registerLocaleData' ) ;
151+ await expectFileToMatch ( `${ baseDir } /fr/main-es2015.js` , 'registerLocaleData' ) ;
152+
145153 // Verify missing translation behaviour.
146154 await appendToFile ( 'src/app/app.component.html' , '<p i18n>Other content</p>' ) ;
147155 await ng ( 'build' , '--i18n-missing-translation' , 'ignore' ) ;
0 commit comments