@@ -183,8 +183,6 @@ export function buildWebpackBrowser(
183
183
( { config, projectRoot, projectSourceRoot, i18n, target, cacheOptions } ) => {
184
184
const normalizedOptimization = normalizeOptimization ( options . optimization ) ;
185
185
186
- const defaultBaseHref = options . baseHref ?? '/' ;
187
-
188
186
return runWebpack ( config , context , {
189
187
webpackFactory : require ( 'webpack' ) as typeof webpack ,
190
188
logging :
@@ -319,7 +317,7 @@ export function buildWebpackBrowser(
319
317
for ( const [ locale , outputPath ] of outputPaths . entries ( ) ) {
320
318
try {
321
319
const { content, warnings, errors } = await indexHtmlGenerator . process ( {
322
- baseHref : getLocaleBaseHref ( i18n , locale ) || defaultBaseHref ,
320
+ baseHref : getLocaleBaseHref ( i18n , locale ) ?? options . baseHref ,
323
321
// i18nLocale is used when Ivy is disabled
324
322
lang : locale || undefined ,
325
323
outputPath,
@@ -363,7 +361,7 @@ export function buildWebpackBrowser(
363
361
projectRoot ,
364
362
context . workspaceRoot ,
365
363
outputPath ,
366
- getLocaleBaseHref ( i18n , locale ) ?? defaultBaseHref ,
364
+ getLocaleBaseHref ( i18n , locale ) ?? options . baseHref ?? '/' ,
367
365
options . ngswConfigPath ,
368
366
) ;
369
367
} catch ( error ) {
@@ -393,10 +391,10 @@ export function buildWebpackBrowser(
393
391
[ ...outputPaths . entries ( ) ] . map ( ( [ locale , path ] ) => ( {
394
392
locale,
395
393
path,
396
- baseHref : getLocaleBaseHref ( i18n , locale ) ?? defaultBaseHref ,
394
+ baseHref : getLocaleBaseHref ( i18n , locale ) ?? options . baseHref ,
397
395
} ) ) ) || {
398
396
path : baseOutputPath ,
399
- baseHref : defaultBaseHref ,
397
+ baseHref : options . baseHref ,
400
398
} ,
401
399
} as BrowserBuilderOutput ) ,
402
400
) ,
0 commit comments