Skip to content

Commit 4f06479

Browse files
wagerfieldpi0
authored andcommitted
fix(module): handle readJSFiles for string param (#143)
1 parent 5d9bec5 commit 4f06479

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/modules/workbox.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ It is recommanded to test workbox using `nuxt build`/`nuxt start`. You can enabl
6767

6868
### `workboxExtensions`
6969

70-
(String) Loads and inserts the contents of the specified file path into the service worker script before any call to `precacheAndRoute`. You may add as many extra calls as you want to this file.
70+
(String|String[]) Loads and inserts the contents of the specified file path into the service worker script before any call to `precacheAndRoute`. You may add as many extra calls as you want to these files.
7171

7272
<!-- Precache -->
7373

@@ -91,7 +91,7 @@ Workbox takes a lot of the heavy lifting out of precaching by simplifying the AP
9191

9292
### `cachingExtensions`
9393

94-
(String) Loads and inserts the contents of the specified file path into the service worker script, below autogenerated calls to `workbox.precaching.*`. You may add as many extra calls as you want to this file.
94+
(String|String[]) Loads and inserts the contents of the specified file path into the service worker script, below autogenerated calls to `workbox.precaching.*`. You may add as many extra calls as you want to these files.
9595

9696
### `cleanupOutdatedCaches`
9797

@@ -129,7 +129,7 @@ Workbox takes a lot of the heavy lifting out of precaching by simplifying the AP
129129

130130
### `routingExtensions`
131131

132-
(String) Loads and inserts the contents of the specified file path into the service worker script, below autogenerated calls to `workbox.routing.*`. You may add as many extra calls as you want to this file.
132+
(String|String[]) Loads and inserts the contents of the specified file path into the service worker script, below autogenerated calls to `workbox.routing.*`. You may add as many extra calls as you want to these files.
133133

134134
### `assetsURLPattern`
135135

packages/workbox/lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { readFileSync, existsSync } = require('fs')
22

33
function readJSFiles (files) {
4-
return Array.from(files)
4+
return Array.from(Array.isArray(files) ? files : [files])
55
.map(path => {
66
path = this.nuxt.resolver.resolvePath(path)
77
if (path && existsSync(path)) {

0 commit comments

Comments
 (0)