exhibit-builder-sw-precache

0.2.0 • Public • Published

sw-precache

Exhibit.js builder plugin

Generates a service worker using the Chrome team’s sw-precache template.

$ npm install -D exhibit-builder-sw-precache

NPM version Build Status Dependency Status devDependency Status peerDependency Status

Usage

  .use('sw-precache', {cacheId: 'foo'})

This looks for cacheable files in your app, and then generates a service-worker.js that will cache those files.

This plugin should go at the end of your build sequence, after all cacheable assets’ contents have been finalized – i.e. after any preprocessors, minifiers, compressers, etc.

Options

include (string/array/function) — default: '**/*.{js,html,css,png,jpg,gif,svg}'

Chooses which files should be included in the service worker cache. Follows Exhibit’s glob convention.

filename (string) — default: 'service-worker.js'

The path for the generated service worker.

Additional options

If set, the following options are used to configure the sw-precache template:


License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i exhibit-builder-sw-precache

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • callumlocke