Skip to content

Commit

Permalink
Enable "gatsby-plugin-offline"
Browse files Browse the repository at this point in the history
Integrated gatsby-plugin-offline (1) that adds drop-in support for
making a Gatsby site work offline and more resistant to bad network
connections. It creates a service worker for the site using the great
Workbox (2) project and loads the service worker into the client.

Note that is recommended to use this plugin together with
gatsby-plugin-manifest (3) (GH-91), but ensure that this plugin is
listed after the offline plugin so that the created
`manifest.webmanifest` file can be included in the service worker!

The plugin comes with optimal configurations out-of-the-box. Note that
the offline support can break when changing these options.

References:
  (1) https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-offline
  (2)  https://developers.google.com/web/tools/workbox
  (3) https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-manifest
  (4) https://www.npmjs.com/package/gatsby-plugin-offline

GH-94
  • Loading branch information
arcticicestudio committed Dec 20, 2018
1 parent d3c1c11 commit 20fc0f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ module.exports = {
{
resolve: "gatsby-plugin-manifest",
options: gatsbyPluginManifestConfig
}
},
/*
* This plugin must definitely be listed last to ensure cache-able files like the web app manifest are included in
* the service worker!
*/
"gatsby-plugin-offline"
]
};

0 comments on commit 20fc0f4

Please sign in to comment.