@@ -39,6 +39,7 @@ export default async function() {
39
39
const appArchitect = appProject . architect || appProject . targets ;
40
40
const serveConfigs = appArchitect [ 'serve' ] . configurations ;
41
41
const e2eConfigs = appArchitect [ 'e2e' ] . configurations ;
42
+ const buildConfigs = appArchitect [ 'build' ] . configurations ;
42
43
43
44
// Make default builds prod.
44
45
appArchitect [ 'build' ] . options . optimization = true ;
@@ -63,6 +64,8 @@ export default async function() {
63
64
} else {
64
65
i18n . locales [ lang ] = `src/locale/messages.${ lang } .xlf` ;
65
66
}
67
+
68
+ buildConfigs [ lang ] = { localize : [ lang ] } ;
66
69
serveConfigs [ lang ] = { browserTarget : `test-project:build:${ lang } ` } ;
67
70
e2eConfigs [ lang ] = {
68
71
specs : [ `./src/app.${ lang } .e2e-spec.ts` ] ,
@@ -142,6 +145,11 @@ export default async function() {
142
145
}
143
146
}
144
147
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
+
145
153
// Verify missing translation behaviour.
146
154
await appendToFile ( 'src/app/app.component.html' , '<p i18n>Other content</p>' ) ;
147
155
await ng ( 'build' , '--i18n-missing-translation' , 'ignore' ) ;
0 commit comments