Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sw-pack

fiws8MIT0.1.0

Generate service workers for web-app deployment with offline-first support

service-worker, offline, cache, release

readme

sw-pack

Build Status Dependency Status

Generate service workers for web-app deployment with offline-first support.

Only supports node 6+

Usage

const packager = require('sw-pack');

packager.generate({
  cache: ['index.html', 'style.css', 'https://example.com/script.js'],
  out: './service-worker.js'
});

Features

  • Caches files by hash, only updates files which changed
  • Does not touch cache which is currently in use
  • Can cache external URLs