@@ -64,6 +64,7 @@ import {
6464 normalizeOptimization ,
6565 normalizeSourceMaps ,
6666} from '../utils' ;
67+ import { I18nOptions , createI18nOptions } from '../utils/i18n-options' ;
6768import { manglingDisabled } from '../utils/mangle-options' ;
6869import {
6970 CacheKey ,
@@ -167,13 +168,23 @@ async function initialize(
167168 context : BuilderContext ,
168169 host : virtualFs . Host < fs . Stats > ,
169170 webpackConfigurationTransform ?: ExecutionTransformer < webpack . Configuration > ,
170- ) : Promise < { config : webpack . Configuration [ ] ; projectRoot : string ; projectSourceRoot ?: string } > {
171+ ) : Promise < {
172+ config : webpack . Configuration [ ] ;
173+ projectRoot : string ;
174+ projectSourceRoot ?: string ;
175+ i18n : I18nOptions ;
176+ } > {
171177 const { config, projectRoot, projectSourceRoot } = await buildBrowserWebpackConfigFromContext (
172178 options ,
173179 context ,
174180 host ,
175181 ) ;
176182
183+ // target is verified in the above call
184+ // tslint:disable-next-line: no-non-null-assertion
185+ const metadata = await context . getProjectMetadata ( context . target ! ) ;
186+ const i18n = createI18nOptions ( metadata ) ;
187+
177188 let transformedConfig ;
178189 if ( webpackConfigurationTransform ) {
179190 transformedConfig = [ ] ;
@@ -190,7 +201,7 @@ async function initialize(
190201 ) . toPromise ( ) ;
191202 }
192203
193- return { config : transformedConfig || config , projectRoot, projectSourceRoot } ;
204+ return { config : transformedConfig || config , projectRoot, projectSourceRoot, i18n } ;
194205}
195206
196207// tslint:disable-next-line: no-big-function
@@ -211,7 +222,7 @@ export function buildWebpackBrowser(
211222
212223 return from ( initialize ( options , context , host , transforms . webpackConfiguration ) ) . pipe (
213224 // tslint:disable-next-line: no-big-function
214- switchMap ( ( { config : configs , projectRoot } ) => {
225+ switchMap ( ( { config : configs , projectRoot, i18n } ) => {
215226 const tsConfig = readTsconfig ( options . tsConfig , context . workspaceRoot ) ;
216227 const target = tsConfig . options . target || ScriptTarget . ES5 ;
217228 const buildBrowserFeatures = new BuildBrowserFeatures ( projectRoot , target ) ;
@@ -591,7 +602,7 @@ export function buildWebpackBrowser(
591602 ? workerFile
592603 : require . resolve ( '../utils/process-bundle-bootstrap' ) ,
593604 'process' ,
594- { cachePath : cacheDownlevelPath } ,
605+ { cachePath : cacheDownlevelPath , i18n } ,
595606 ) ;
596607
597608 try {
0 commit comments