@gdexporter/plugin-offline

1.0.0 • Public • Published

plugin-offline

Generates a service worker for caching using workbox, to allow playing the game offline.

Options

{
  workerFileName: "sw.js",
  sourceWorker: "./myWorker.js",
  workboxOptions: {
    runtimeCache: [
      {
        urlPattern: "*",
        handler: "NetworkFirst",
      },
    ],
  },
}

workerFileName = "sw.js"

The filename of the output service worker.

sourceWorker = undefined

If a string is passed as sourceWorker, the plugin will use injectManifest instead of generateSW. You can find the differences on the official workbox docs.

workboxOptions = {runtimeCaching: [{ urlPattern: "*", handler: "NetworkFirst" }], globPatterns: ["**/*"]}

The options passed to workbox when building. You can find them on the official workbox docs. Be aware that the available options may vary depending on if you use injectManifest or generateSW (see the sourceWorker option).

Package Sidebar

Install

npm i @gdexporter/plugin-offline

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

94.2 kB

Total Files

5

Last publish

Collaborators

  • arthuro555