Skip to content

Commit

Permalink
docs: remove outdated info about ng serve (angular#53890)
Browse files Browse the repository at this point in the history
PR Close angular#53890
  • Loading branch information
mooyil authored and thePunderWoman committed Feb 1, 2024
1 parent 32d0742 commit bdf6927
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions aio/content/guide/service-worker-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,25 @@ ng build # build the app for production; code is in the /dist folde

</code-example>

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:

<code-example format="shell" language="shell">

ng serve --prod

</code-example>

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:

<code-example format="shell" language="shell">

npx http-server -p 8080 -c-1 dist/&lt;project-name&gt;/browser

</code-example>

This will serve your application with service worker support at http://localhost:8080.

</div>

### Initial load
Expand Down

0 comments on commit bdf6927

Please # to comment.