A plugin for Parcel to generate a service worker with Workbox.
You can either install by running yarn (recommended)
yarn add parcel-plugin-workbox --dev
or use npm
npm install parcel-plugin-workbox --save-dev
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>
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details.