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(
729
729
}
730
730
731
731
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
+
733
743
try {
734
744
await augmentAppWithServiceWorker (
735
745
host ,
736
746
root ,
737
747
normalize ( projectRoot ) ,
738
748
normalize ( outputPath ) ,
739
- options . baseHref || '/' ,
749
+ localeBaseHref || options . baseHref || '/' ,
740
750
options . ngswConfigPath ,
741
751
) ;
742
752
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments