egg-sw

1.0.2 • Public • Published

egg-sw

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-sw --save

Usage

// {app_root}/config/plugin.js
exports.sw = {
  enable: true,
  package: 'egg-sw',
};

Configuration

// {app_root}/config/config.default.js
exports.sw = {
  prefix: '/',
  path: '/service-worker.js',
  dir: path.join(appInfo.baseDir, 'app/public'),
  preload: false,
  buffer: false,
  maxFiles: 1,
  dynamic: true,
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-sw

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

7.91 kB

Total Files

8

Last publish

Collaborators

  • tingxin_cy