0.2.0 • Published 9 years ago

exhibit-builder-sw-precache v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

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

0.2.0

9 years ago

0.1.0

9 years ago