parcel-plugin-workbox2

0.0.5 • Public • Published

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.

Package Sidebar

Install

npm i parcel-plugin-workbox2

Weekly Downloads

6

Version

0.0.5

License

MIT

Unpacked Size

7.99 kB

Total Files

11

Last publish

Collaborators

  • peanutbother