1 | # Workbox Unofficial CDN
|
2 |
|
3 | [![automated](https://flat.badgen.net/badge/publish/automated/green)](#)
|
4 | [![circle ci](https://flat.badgen.net/circleci/github/nuxt-community/workbox-cdn)](https://circleci.com/gh/nuxt-community/workbox-cdn)
|
5 | [![npm version](https://flat.badgen.net/npm/v/workbox-cdn)](https://www.npmjs.com/package/workbox-cdn)
|
6 | [![npm downloads](https://flat.badgen.net/npm/dt/workbox-cdn)](https://www.npmjs.com/package/workbox-cdn)
|
7 | [![install size](https://flat.badgen.net/packagephobia/install/workbox-cdn)](https://packagephobia.now.sh/result?p=workbox-cdn)
|
8 | [![](https://data.jsdelivr.com/v1/package/npm/workbox-cdn/badge)](https://www.jsdelivr.com/package/npm/workbox-cdn)
|
9 |
|
10 | [Workbox](https://github.com/GoogleChrome/workbox) Unofficial CDN and standalone NPM package.
|
11 |
|
12 | ## Why?
|
13 |
|
14 | - Having public usage/download stats
|
15 | - The `local` type costs `~8M` install size for `workbox-cli` package vs `< 1Mb` of this package
|
16 | - Default workbox CDN is hosted on `storage.googleapis.com` which is sometimes unavailable
|
17 |
|
18 | ## Usage
|
19 |
|
20 | Add a call to `workbox.setConfig({modulePathPrefix: '...'})` to your service worker to use hosted workbox libraries.
|
21 |
|
22 | See https://goo.gl/Fo9gPX for further documentation.
|
23 |
|
24 | You have two options:
|
25 |
|
26 | ### Option 1: JSDelivr
|
27 |
|
28 | Use `https://cdn.jsdelivr.net/npm/workbox-cdn/workbox/workbox-sw.js`
|
29 |
|
30 | ### Option 2: NPM Package
|
31 |
|
32 | Install `workbox-cdn` package with `yarn add workbox-cdn` or `npm i workbox-cdn` and integrate it with your own build system or serve contents of `workbox` dir
|
33 |
|
34 | ## License
|
35 |
|
36 | ```
|
37 | Copyright 2018 Google LLC
|
38 |
|
39 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
40 | of this software and associated documentation files (the "Software"), to deal
|
41 | in the Software without restriction, including without limitation the rights
|
42 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
43 | copies of the Software, and to permit persons to whom the Software is
|
44 | furnished to do so, subject to the following conditions:
|
45 |
|
46 | The above copyright notice and this permission notice shall be included in
|
47 | all copies or substantial portions of the Software.
|
48 |
|
49 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
51 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
52 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
54 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
55 | THE SOFTWARE.
|
56 | ```
|