Angular: Possible to use PWA on development server (ng serve)?


I’m working on an application where I’m using PWA for the first time and I’m trying to work with push notifications etc.

Currently I have PWA working if I execute the following commands ng build --prod and http-server -p 8080 -c-1 dist/myProject, but I was wondering if there was a way to have PWA work on ng serve so that I don’t constantly have to build the project because that takes quite some time.

EDIT: Added information

I tried modifying the serve object in angular.json by adding

            "assets": [

to the options attribute but this gives the error Data path "" should NOT have additional properties(assets) so I suppose that this is not the way to go.


From the documentation:

Because ng serve does not work with service workers, you must use a separate HTTP server to test your project locally.

Basically you can develop your app using the ng serve but you can’t install it or have updates when using ng serve. For that purposes you have to use the http-server

Answered By – Leonardo Alves

Answer Checked By – Pedro (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.