🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

parcel-plugin-workbox-rev

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-workbox-rev

An updated plugin for Parcel to generate a service worker with Workbox

latest
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

parcel-plugin-workbox-rev

An updated plugin for Parcel to generate a service worker with Workbox, derived from Anders Dahnielson's parcel-plugin-workbox.

Install

You can either install by running yarn (recommended)

yarn add parcel-plugin-workbox-rev --dev

or use npm

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

Usage

When you build resources with Parcel, the plugin will generate a service worker sw.js and insert it into your project's index.html entry file.

You can customize the settings by adding a workbox section to your package.json.

"workbox": {
  importScripts: ['./worker.js'],           // scripts to import into `sw.js`
  globDirectory: './dist',                  // directory to cache (usually output dir)
  globPatterns: [                           // file types to include
  '**/*.{css,html,js,gif,ico,jpg,png,svg,webp,woff,woff2,ttf,otf}'
}

Workbox requires at least one import script to be defined. By default, a worker.js file, where you can write the logic for your service worker, will be read from your project's root directory and imported into sw.js unless you change this setting. Additionally, a CDN version of Google Workbox is imported automatically.

Note: If you have this plugin active during development, you will need to either disable or manually delete the service worker to bypass caching.

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.

Keywords

parcel

FAQs

Package last updated on 01 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts