@vuepress/plugin-pwa 1.9.1 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +19 -8
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  > PWA plugin for VuePress
4
4
 
5
- See [documentation](https://v1.vuepress.vuejs.org/plugin/official/plugin-pwa.html).
5
+ See [documentation](https://vuepress.vuejs.org/plugin/official/plugin-pwa.html).
package/index.js CHANGED
@@ -1,11 +1,17 @@
1
1
  const { logger, fs, path } = require('@vuepress/shared-utils')
2
2
 
3
- module.exports = ({
4
- serviceWorker = true,
5
- updatePopup = false,
6
- popupComponent = 'SWUpdatePopup',
7
- generateSWConfig = {}
8
- }, context) => ({
3
+ /**
4
+ * @type {import('@vuepress/types').Plugin}
5
+ */
6
+ module.exports = (
7
+ {
8
+ serviceWorker = true,
9
+ updatePopup = false,
10
+ popupComponent = 'SWUpdatePopup',
11
+ generateSWConfig = {}
12
+ },
13
+ context
14
+ ) => ({
9
15
  alias: {
10
16
  '@sw-event': path.resolve(__dirname, 'lib/event.js')
11
17
  },
@@ -33,12 +39,17 @@ module.exports = ({
33
39
  await wbb.generateSW({
34
40
  swDest: swFilePath,
35
41
  globDirectory: outDir,
36
- globPatterns: ['**\/*.{js,css,html,png,jpg,jpeg,gif,svg,woff,woff2,eot,ttf,otf}'],
42
+ globPatterns: [
43
+ '**/*.{js,css,html,png,jpg,jpeg,gif,svg,woff,woff2,eot,ttf,otf}'
44
+ ],
37
45
  ...generateSWConfig
38
46
  })
39
47
  await fs.writeFile(
40
48
  swFilePath,
41
- await fs.readFile(path.resolve(__dirname, 'lib/skip-waiting.js'), 'utf8'),
49
+ await fs.readFile(
50
+ path.resolve(__dirname, 'lib/skip-waiting.js'),
51
+ 'utf8'
52
+ ),
42
53
  { flag: 'a' }
43
54
  )
44
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/plugin-pwa",
3
- "version": "1.9.1",
3
+ "version": "1.9.5",
4
4
  "description": "pwa plugin for vuepress",
5
5
  "keywords": [
6
6
  "documentation",
@@ -21,12 +21,13 @@
21
21
  "author": "ULIVZ <chl814@foxmail.com>",
22
22
  "main": "index.js",
23
23
  "dependencies": {
24
- "@vuepress/shared-utils": "1.9.1",
24
+ "@vuepress/shared-utils": "1.9.5",
25
+ "@vuepress/types": "1.9.5",
25
26
  "register-service-worker": "^1.7.0",
26
27
  "workbox-build": "^4.3.1"
27
28
  },
28
29
  "publishConfig": {
29
30
  "access": "public"
30
31
  },
31
- "gitHead": "2ffd506ca0ccc2203c3786cd80b6979d95ed9431"
32
+ "gitHead": "ef6f87a5cc23903b74a86cffda325abafa7fe5e8"
32
33
  }