Skip to content

Commit

Permalink
docs: clarify how to remove SW (#11540)
Browse files Browse the repository at this point in the history
* Improve SW removal docs

* yarn -> npm
  • Loading branch information
valin4tor authored and DSchau committed Feb 6, 2019
1 parent d9e2883 commit b569ae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/docs/add-offline-support-with-a-service-worker.md
Expand Up @@ -74,6 +74,10 @@ exports.registerServiceWorker = () => true

That's all! Gatsby will register your custom service worker.

### Removing the service worker

If you would like to fully remove the service worker from your site, you can use the plugin `gatsby-plugin-remove-serviceworker` in place of `gatsby-plugin-offline`. See [the README for `gatsby-plugin-offline`](/packages/gatsby-plugin-offline/#remove) for instructions how to do this.

## References

- [Service Workers: an Introduction](https://developers.google.com/web/fundamentals/primers/service-workers/)
Expand Down
9 changes: 8 additions & 1 deletion packages/gatsby-plugin-offline/README.md
Expand Up @@ -68,7 +68,14 @@ const options = {

If you want to remove `gatsby-plugin-offline` from your site at a later point,
substitute it with [`gatsby-plugin-remove-serviceworker`](https://www.npmjs.com/package/gatsby-plugin-remove-serviceworker)
to safely remove the service worker:
to safely remove the service worker. First, install the new package:

```bash
npm install gatsby-plugin-remove-serviceworker
npm uninstall gatsby-plugin-offline
```

Then, update your `gatsby-config.js`:

```diff:title=gatsby-config.js
plugins: [
Expand Down

0 comments on commit b569ae5

Please sign in to comment.