1.0.3 • Published 5 years ago

razzle-plugin-serviceworker v1.0.3

Weekly downloads
433
License
ISC
Repository
github
Last release
5 years ago

razzle-plugin-serviceworker

Build Status Coverage Status npm dependencies Status devDependencies Status

A serviceworker for Razzle using offline-plugin.

Installation

Node.js

$ npm install razzle-plugin-serviceworker --save-dev
$ npm install offline-plugin --save

Configuration

Edit or create razzle.config.js in your project root.

// razzle.config.js
module.exports = {
  plugins: ['serviceworker'],
};

Add serviceWorker to client

Add to src/client.js

import * as OfflinePluginRuntime from "offline-plugin/runtime";
OfflinePluginRuntime.install();

Adding server side webpack plugin options

// razzle.config.js
module.exports = {
  plugins: [{
      name:'serviceworker',
      options: {
          autoUpdate: true
      }
  }],
};

License

ISC

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago