My co-worker, Aaron Carlson , posted this on Teams and gave me permission to share what he wrote.
I was able to successfully create an Angular 5 app with Service Worker. It was pretty simple. The trick seems to be that you need to serve the application from the dist folder using “http-server” instead of using “ng serve”. This doesn’t hook up the browserLink functionality but the application will still work even when you stop the http-server. There must be a way to have the service worker running separately from the application so that you can develop the app with the BrowserLink, but I haven’t been able to figure that out yet.
npm install -g @angular/cli@latest
ng new AppName --service-worker
ng build --prod
npm install http-server -g
http-server
The information was found here .
We’re very interested in PWAs and have been learning a lot, when we can find the time. We think this a great set of technologies for building web applications.
For adding the service-worker, I followed this guide
Checkout my (Kevin) list of PWA links .
Please consider using Brave and adding me to your BAT payment ledger. Then you won't have to see ads! (when I get to $100 in Google Ads for a payout, I pledge to turn off ads)
Also check out my Resources Page for referrals that would help me.