@next-with-offline/next-plugin

4.0.1 • Public • Published

@next-with-offline/next-plugin

size dependencies build downloads license

Next.js plugin for generating a Workbox. Intended to be used alongside @next-with-offline/react-hook and @next-with-offline/service-worker. Read the top level documentation for more information about usage.

Install

yarn add @next-with-offline/next-plugin

Basic Usage

Update or create next.config.js with

const withOffline = require("@next-with-offline/next-plugin");

module.exports = withOffline({
  offline: {
    path: "/offline",
  },
  workbox: {
    dest: "public",
    swDest: "sw.js",
    swSrc: "worker.js",
    // .
    // ..
    // ... other workbox-webpack-plugin.InjectManifest options
  },
  // .
  // ..
  // ... other Next.js config
});

Add public/sw.js and public/sw.js.map to your .gitignore

public/sw.js
public/sw.js.map

Package Sidebar

Install

npm i @next-with-offline/next-plugin

Weekly Downloads

0

Version

4.0.1

License

MIT

Unpacked Size

5.63 kB

Total Files

6

Last publish

Collaborators

  • cansin