@@ -2,11 +2,7 @@ import './scss/styles.scss';
22import 'bootstrap' ;
33
44import { registerApplication , start } from 'single-spa' ;
5- import {
6- constructApplications ,
7- constructRoutes ,
8- constructLayoutEngine ,
9- } from 'single-spa-layout' ;
5+ import { constructApplications , constructRoutes , constructLayoutEngine } from 'single-spa-layout' ;
106import microfrontendLayout from './microfrontend-layout.html' ;
117import { register } from 'register-service-worker' ;
128
@@ -17,9 +13,7 @@ function isLocalhost() {
1713 // [::1] is the IPv6 localhost address.
1814 window . location . hostname === '[::1]' ||
1915 // 127.0.0.1/8 is considered localhost for IPv4.
20- window . location . hostname . match (
21- / ^ 1 2 7 (?: \. (?: 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) ) { 3 } $ / ,
22- ) ,
16+ window . location . hostname . match ( / ^ 1 2 7 (?: \. (?: 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) ) { 3 } $ / ) ,
2317 ) ;
2418}
2519
@@ -45,22 +39,16 @@ if (!isLocalhost())
4539 console . log ( 'Service worker has been registered:' + registration ) ;
4640 } ,
4741 cached ( registration ) {
48- console . log (
49- 'Content has been cached for offline use:' + registration ,
50- ) ;
42+ console . log ( 'Content has been cached for offline use:' + registration ) ;
5143 } ,
5244 updatefound ( registration ) {
5345 console . log ( 'New content is downloading:' + registration ) ;
5446 } ,
5547 updated ( registration ) {
56- console . log (
57- 'New content is available; please refresh:' + registration ,
58- ) ;
48+ console . log ( 'New content is available; please refresh:' + registration ) ;
5949 } ,
6050 offline ( ) {
61- console . log (
62- 'No internet connection found. App is running in offline mode.' ,
63- ) ;
51+ console . log ( 'No internet connection found. App is running in offline mode.' ) ;
6452 } ,
6553 error ( error ) {
6654 console . error ( 'Error during service worker registration:' , error ) ;
0 commit comments