From bdf6927125d17a09c49e42f523781547aa5a8b2d Mon Sep 17 00:00:00 2001 From: mooyil Date: Thu, 11 Jan 2024 21:49:29 +0100 Subject: [PATCH] docs: remove outdated info about ng serve (#53890) PR Close #53890 --- .../guide/service-worker-getting-started.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aio/content/guide/service-worker-getting-started.md b/aio/content/guide/service-worker-getting-started.md index 8111e2c8b3ea93..cdbe8a5d5e3a9e 100644 --- a/aio/content/guide/service-worker-getting-started.md +++ b/aio/content/guide/service-worker-getting-started.md @@ -61,9 +61,16 @@ ng build # build the app for production; code is in the /dist folde -The Angular development server (`ng serve`) doesn't support service worker applications. -The [`http-server package`](https://www.npmjs.com/package/http-server) from npm does. -You can run it without installing it like this: +To enable service worker support during local development, use the production configuration with the following command: + + + +ng serve --prod + + + +Alternatively, you can use the [`http-server package`](https://www.npmjs.com/package/http-server) from +npm, which supports service worker applications. Run it without installation using: @@ -71,6 +78,8 @@ npx http-server -p 8080 -c-1 dist/<project-name>/browser +This will serve your application with service worker support at http://localhost:8080. + ### Initial load