File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/angular_devkit/build_angular/src/browser Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -729,14 +729,24 @@ export function buildWebpackBrowser(
729729 }
730730
731731 if ( ! options . watch && options . serviceWorker ) {
732- for ( const outputPath of outputPaths . values ( ) ) {
732+ for ( const [ locale , outputPath ] of outputPaths . entries ( ) ) {
733+ let localeBaseHref ;
734+ if ( i18n . locales [ locale ] && i18n . locales [ locale ] . baseHref !== '' ) {
735+ localeBaseHref = path . posix . join (
736+ options . baseHref || '' ,
737+ i18n . locales [ locale ] . baseHref === undefined
738+ ? `/${ locale } /`
739+ : i18n . locales [ locale ] . baseHref ,
740+ ) ;
741+ }
742+
733743 try {
734744 await augmentAppWithServiceWorker (
735745 host ,
736746 root ,
737747 normalize ( projectRoot ) ,
738748 normalize ( outputPath ) ,
739- options . baseHref || '/' ,
749+ localeBaseHref || options . baseHref || '/' ,
740750 options . ngswConfigPath ,
741751 ) ;
742752 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments