Reputation: 274
I have problem with situaton:
ng serve --prod
to Service Worker is registeredng build --prod
to Service Worker is NOT registered. Missing files in dist
ngsw
Upvotes: 2
Views: 117
Reputation: 10820
Angular ng serve
does not work with service worker.
You need to do a prod build and then serve the application from the /dist
folder. You can use any web server you prefer: npm http-server or the web server as Chrome Extension. This way you can test the service worker locally.
You can have a look at this article, where I explain step by step how to create a PWA with Angular.
The article also refers to a Github Project with a running Angular PWA app, that you can use as starting point or to compare it with your code.
Upvotes: 2