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 @@ -703,14 +703,24 @@ export function buildWebpackBrowser(
703
703
}
704
704
705
705
if ( ! options . watch && options . serviceWorker ) {
706
- for ( const outputPath of outputPaths . values ( ) ) {
706
+ for ( const [ locale , outputPath ] of outputPaths . entries ( ) ) {
707
+ let localeBaseHref ;
708
+ if ( i18n . locales [ locale ] && i18n . locales [ locale ] . baseHref !== '' ) {
709
+ localeBaseHref = path . posix . join (
710
+ options . baseHref || '' ,
711
+ i18n . locales [ locale ] . baseHref === undefined
712
+ ? `/${ locale } /`
713
+ : i18n . locales [ locale ] . baseHref ,
714
+ ) ;
715
+ }
716
+
707
717
try {
708
718
await augmentAppWithServiceWorker (
709
719
host ,
710
720
root ,
711
721
normalize ( projectRoot ) ,
712
722
normalize ( outputPath ) ,
713
- options . baseHref || '/' ,
723
+ localeBaseHref || options . baseHref || '/' ,
714
724
options . ngswConfigPath ,
715
725
) ;
716
726
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments