0.0.5 • Published 6 years ago

parcel-plugin-workbox2 v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

parcel-plugin-workbox

Travis CI badge Greenkeeper badge Standard JS badge

A plugin for Parcel to generate a service worker with Workbox.

Install

You can either install by running yarn (recommended)

yarn add parcel-plugin-workbox --dev

or use npm

npm install parcel-plugin-workbox --save-dev

Usage

When you build resources with Parcel, the plugin will generate a service worker sw.js that you can register in your web page:travi

<script>
// Check that service workers are registered
if ('serviceWorker' in navigator) {
  // Use the window load event to keep the page load performant
  window.addEventListener('load', () => {
    navigator.serviceWorker.register('/sw.js');
  });
}
</script>

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.