5.2.0 • Published 2 months ago

gatsby-plugin-offline v5.2.0

Weekly downloads
213,253
License
MIT
Repository
github
Last release
2 months ago

gatsby-plugin-offline

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 and loads the service worker into the client.

If you're using this plugin with gatsby-plugin-manifest (recommended) this plugin should be listed after that plugin so the manifest file can be included in the service worker.

Install

npm install --save gatsby-plugin-offline

How to use

// In your gatsby-config.js
plugins: [`gatsby-plugin-offline`];

Overriding options

When adding this plugin to your gatsby-config.js, you can pass in options to override the default sw-precache config.

The default config is as following. Warning, you can break the offline support and AppCache setup by changing these options so tread carefully.

const options = {
  staticFileGlobs: [
    `${rootDir}/**/*.{js,woff2}`,
    `${rootDir}/index.html`,
    `${rootDir}/manifest.json`,
    `${rootDir}/offline-plugin-app-shell-fallback/index.html`,
  ],
  stripPrefix: rootDir,
  navigateFallback: `/offline-plugin-app-shell-fallback/index.html`,
  // Only match URLs without extensions.
  // So example.com/about/ will pass but
  // example.com/cheeseburger.jpg will not.
  // We only want the service worker to handle our "clean"
  // URLs and not any files hosted on the site.
  navigateFallbackWhitelist: [/^.*(?!\.\w?$)/],
  cacheId: `gatsby-plugin-offline`,
  // Do cache bust JS URLs until can figure out how to make Webpack's
  // URLs truely content-addressed.
  dontCacheBustUrlsMatching: /(.\w{8}.woff2)/, //|-\w{20}.js)/,
  runtimeCaching: [
    {
      // Add runtime caching of images.
      urlPattern: /\.(?:png|jpg|jpeg|webp|svg|gif|tiff)$/,
      handler: `fastest`,
    },
  ],
  skipWaiting: false,
};
gatsby-plugin-rave@smartassdesign/gatsby-theme-themify@puzzledbytheweb/gatsby-theme-ecommerce-core@studiobear/gatsby-theme-ionic@studiobear/gatsby-theme-blog@prg/gatsby-theme-bedrockjamstack-boilerplate@hacktion/test-librarygatsby-theme-ghost-reloadedgatsby-theme-crystyallizegatsby-startyer-crystyallizegatsby-universal@nowseemee/monument@rubrik/docs@dewen_li/gatsby-theme-bodilessgatsby-theme-kuworking-landing-onewebiu-testgatsby-fassetgatsby-theme-bejamas-coregatsby-theme-fierce-vanillagatsby-theme-lumengatsby-theme-memoriestorichegatsby-theme-factlytheme-gatsby-shopifygatsby-theme-jdoe@meetup/build-meetup-web-componentsnuven-code-editorsix-foot-six-designs@fujuntao/use-form-websitefielder-docsgatsby-typescript-default-startergatsby-typescript-material-ui-startergatsby-typescript-tailwind-starter@garytee/gatsby-woo-elementorgatsby-woocommerce-elementor-theme@leptest/gatsby-netlify-cmsgatsby-theme-wom-browsegatsby-theme-wom-cartgatsby-theme-wom-checkoutgatsby-theme-wom-login@fengshangwuqi/gatsby-configgatsby-starter-essentials@roman-hotsiy/redocly-dev-portal@whey/gatsby-theme-whey@weknow/gatsby-theme-drupal-boina@wesleylhandy/gatsby-theme-author-base@westegg/gatsby-theme-core@zairon87/gatsby-theme-pixafy@xops.net/gatsby-openrpc-themegatsby-emotion-tailwind-starterblunchers-www@matthieuauger/gatsby-theme-meetupbch-wallet-plugin-boilerplateinvbeertoryjonasbroms-wwwjay-blogicons-siteklair.colisixianmicmax.pwob-frontendodduse-wwwocular-gatsbyomochi-ui-themeorg-themereact-holidayresium-sat-trackerremigespl-hatchlabs-styles-testpersonal-sitembernetinaked_doclmnts-gatsby-ts-skeletonsavedalsloppetseeds-docsshipityohemingway-clihemingway-doc-generatorraylogrocketbeltantd-site-commonblocks-docsblog-theme-lemurbrawl-capped-webpagebrainy-themeawesome-material-ui-starterbart-van-der-waerdenfluent-rn-websiteforesight-gatsby-startergatsby--wordpress-theme-auroragatsby-all-pack-theme-startergat-themegatsby-theme-ultronelegatsby-theme-w3fgatsby-theme-weathergatsby-theme-webhart-basegatsby-theme-west-egg-coregatsby-theme-whitebrickgatsby-theme-wom-coregatsby-theme-yoshino
5.1.4

2 months ago

5.1.3

2 months ago

5.1.2

2 months ago

5.1.1

2 months ago

5.2.0

2 months ago

5.2.0-next.2

2 months ago

5.2.0-next.1

2 months ago

5.3.0-next.1

2 months ago

5.3.0-next.0

2 months ago

5.1.0

3 months ago

5.2.0-next.0

3 months ago

5.1.0-next.0

3 months ago

5.0.0

3 months ago

5.0.0-zz-next.2

4 months ago

5.0.0-zz-next.3

3 months ago

4.14.0

4 months ago

5.0.0-zz-next.0

4 months ago

5.0.0-zz-next.1

4 months ago

5.0.0-next.2

4 months ago

5.0.0-next.1

4 months ago

5.0.0-next.0

4 months ago

4.14.0-next.2

5 months ago

4.14.0-next.1

5 months ago

4.13.0

5 months ago

4.14.0-next.0

5 months ago

4.13.0-next.2

5 months ago

4.13.0-next.1

5 months ago

4.12.0

5 months ago

4.13.0-next.0

5 months ago

4.12.0-next.3

6 months ago

4.12.0-next.2

6 months ago

4.12.0-next.1

6 months ago

4.11.0

6 months ago

4.12.0-next.0

6 months ago

4.10.0

6 months ago

4.11.0-next.0

6 months ago

4.10.0-next.1

7 months ago

4.9.0

7 months ago

4.10.0-next.0

7 months ago

4.9.0-next.1

7 months ago

4.8.0

7 months ago

4.9.0-next.0

7 months ago

4.7.0-next.2

8 months ago

4.7.0-next.1

8 months ago

4.8.0-next.0

8 months ago

4.8.0-next.1

8 months ago

4.7.0

8 months ago

4.7.1

8 months ago

4.6.0

8 months ago

4.7.0-next.0

8 months ago

4.5.0-next.0

9 months ago

4.4.0

9 months ago

4.4.0-next.3

9 months ago

4.6.0-next.1

8 months ago

4.6.0-next.0

9 months ago

4.5.0

8 months ago

4.5.1

8 months ago

4.4.0-next.1

9 months ago

4.3.0

9 months ago

4.4.0-next.0

10 months ago

4.3.0-next.1

10 months ago

4.2.0

10 months ago

4.3.0-next.0

10 months ago

4.1.0

10 months ago

4.2.0-next.0

11 months ago

4.1.0-next.2

11 months ago

4.0.0

11 months ago

4.0.0-v3rc.0

11 months ago

4.1.0-next.1

11 months ago

4.1.0-next.0

11 months ago

4.0.0-next.3

11 months ago

3.10.2

11 months ago

4.0.0-next.2

11 months ago

3.10.1

11 months ago

4.0.0-next.1

11 months ago

4.0.0-next.0

12 months ago

3.10.0

12 months ago

3.11.0-next.0

12 months ago

3.9.0

1 year ago

3.10.0-next.0

1 year ago

3.9.0-next.1

1 year ago

3.8.0

1 year ago

3.9.0-next.0

1 year ago

3.8.0-next.2

1 year ago

3.7.1

1 year ago

3.8.0-next.1

1 year ago

3.7.0

1 year ago

3.8.0-next.0

1 year ago

3.6.0

1 year ago

3.7.0-next.0

1 year ago

3.5.0

1 year ago

3.6.0-next.0

1 year ago

3.4.0

1 year ago

3.5.0-next.0

1 year ago

3.4.0-next.1

1 year ago

3.3.3

1 year ago

3.3.2

1 year ago

3.4.0-next.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.38

1 year ago

3.2.37

1 year ago

3.2.36

1 year ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.33

1 year ago

3.2.32

1 year ago

3.2.31

1 year ago

3.2.30

1 year ago

3.2.29

1 year ago

3.2.28

1 year ago

3.2.27

1 year ago

3.2.26

1 year ago

3.2.25

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.20

2 years ago

3.2.19

2 years ago

3.2.18

2 years ago

3.2.17

2 years ago

3.2.16

2 years ago

3.2.15

2 years ago

3.2.13

2 years ago

3.2.12

2 years ago

3.2.11

2 years ago

3.2.10

2 years ago

3.2.9

2 years ago

3.2.8

2 years ago

3.2.7

2 years ago

3.2.6

2 years ago

3.2.5

2 years ago

3.2.4

2 years ago

3.2.3

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.5

2 years ago

3.1.4

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.42

2 years ago

3.0.41

2 years ago

3.0.40

2 years ago

3.0.39

2 years ago

3.0.38

2 years ago

3.0.36

2 years ago

3.0.37

2 years ago

3.0.35

2 years ago

3.0.34

2 years ago

3.0.33

2 years ago

3.0.32

2 years ago

3.0.31

2 years ago

3.0.30

2 years ago

3.0.29

2 years ago

3.0.27

2 years ago

3.0.26

2 years ago

3.0.24

2 years ago

3.0.25

2 years ago

3.0.23

2 years ago

3.0.22

2 years ago

3.0.21

2 years ago

3.0.20

2 years ago

3.0.19

2 years ago

3.0.18

2 years ago

3.0.17

2 years ago

3.0.16

2 years ago

3.0.15

2 years ago

3.0.14

2 years ago

3.0.13

2 years ago

3.0.12

2 years ago

3.0.11

2 years ago

3.0.9

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.2.10

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.2.5

2 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.25

3 years ago

2.0.25-alpha.0

3 years ago

2.0.24

3 years ago

2.0.23

3 years ago

2.0.22

3 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.18

3 years ago

2.0.17

3 years ago

2.0.16

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.0-rc.9

3 years ago

2.0.0-rc.8

3 years ago

2.0.0-rc.7

3 years ago

2.0.0-rc.6

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-rc.4

3 years ago

2.0.0-rc.3

3 years ago

2.0.0-rc.2

3 years ago

2.0.0-rc.1

3 years ago

2.0.0-rc.0

3 years ago

2.0.0-beta.10

3 years ago

2.0.0-beta.9

3 years ago

2.0.0-beta.8

3 years ago

2.0.0-beta.7

3 years ago

2.0.0-beta.6

3 years ago

2.0.0-beta.5

3 years ago

2.0.0-beta.4

4 years ago

2.0.0-beta.3

4 years ago

2.0.0-beta.2

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

2.0.0-alpha.19

4 years ago

2.0.0-alpha.18

4 years ago

2.0.0-alpha.17

4 years ago

2.0.0-alpha.16

4 years ago

1.0.18

4 years ago

2.0.0-alpha.15

4 years ago

2.0.0-alpha.14

4 years ago

1.0.17

4 years ago

2.0.0-alpha.13

4 years ago

2.0.0-alpha.12

4 years ago

2.0.0-alpha.11

4 years ago

2.0.0-alpha.9

4 years ago

1.0.16

4 years ago

2.0.0-alpha.8

4 years ago

2.0.0-alpha.7

4 years ago

2.0.0-alpha.6

4 years ago

2.0.0-alpha.5

4 years ago

2.0.0-alpha.4

4 years ago

2.0.0-alpha.3

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

2.0.0-alpha.2

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

2.0.0-alpha.1

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

2.0.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.3

5 years ago

1.0.0-beta.1

5 years ago

1.0.0-alpha.23

5 years ago

1.0.0-alpha.22

5 years ago

1.0.0-alpha19

5 years ago

1.0.0-alpha17

5 years ago

1.0.0-alpha16

5 years ago

1.0.0-alpha14

5 years ago

1.0.0-alpha13

5 years ago

1.0.0-alpha12

5 years ago