1.2.1 • Published 4 years ago

parcel-plugin-workbox3 v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Parcel Plugin Workbox 3

issues last commit

THIS PACKAGE IS DEPRECATED AND WILL BE DELETED!

Fork of parcel-plugin-workbox by Anders Dahnielson.

Install

npm i parcel-plugin-workbox3 -D

Usage

When you build with Parcel, this plugin will automatically run generateSWString. You can customize the settings by adding a workbox section to your package.json. The full configuration options can be found here. Unfortunately, parcel will not resolve files when you use navigator.serviceWorker.register, so you must add your service worker to your parcel build target (In addition to your index file).

Example

package.json

{
  "workbox": {
    "importScripts": [
      "./worker.js"
    ],
  }
}

Note: you must include at least one script in the importScripts property.


index.js

const pkg = require('package.json');
navigator.serviceWorker.register(`./${pkg.workbox.swDest}`);

Note: importing package.json is generally considered insecure

FAQ

  • Whats different between this and the original?
    • Still maintained
    • Fixed uglify JS
    • Improved configuration support
      • Pass any configuration option you would normally pass to generateSWString
    • Local workbox copy
    • Reduced logging
  • Why not parcel-plugin-workbox2?
    • The name was already already taken on NPM
  • Why is this deprecated?
    • The main reason why this was created was for Cloud CNC which as of February, 2020 is no longer using Parcel. I don't use Parcel on any other projects as of now so I decided to deprecate this package as I don't have time to maintain it.
1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago