Skip to content

Commit

Permalink
fix(module): handle readJSFiles for string param (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
wagerfield authored and pi0 committed Feb 16, 2019
1 parent 5d9bec5 commit 4f06479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/modules/workbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ It is recommanded to test workbox using `nuxt build`/`nuxt start`. You can enabl

### `workboxExtensions`

(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.
(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.

<!-- Precache -->

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

### `cachingExtensions`

(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.
(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.

### `cleanupOutdatedCaches`

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

### `routingExtensions`

(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.
(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.

### `assetsURLPattern`

Expand Down
2 changes: 1 addition & 1 deletion packages/workbox/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { readFileSync, existsSync } = require('fs')

function readJSFiles (files) {
return Array.from(files)
return Array.from(Array.isArray(files) ? files : [files])
.map(path => {
path = this.nuxt.resolver.resolvePath(path)
if (path && existsSync(path)) {
Expand Down

0 comments on commit 4f06479

Please sign in to comment.