From 1beebd44023501d182b8e80379d9e34f06e61d03 Mon Sep 17 00:00:00 2001 From: darkside Date: Thu, 16 Nov 2017 11:30:39 +0200 Subject: [PATCH] Add option to register third-party SW --- packages/workbox/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/workbox/index.js b/packages/workbox/index.js index 594ac2b1..0853c5ad 100755 --- a/packages/workbox/index.js +++ b/packages/workbox/index.js @@ -62,11 +62,12 @@ module.exports = function nuxtWorkbox (options) { }) // Register runtime plugin + const swURL = `${routerBase}/${options.swURL || swFileName}` this.addPlugin({ src: path.resolve(__dirname, 'plugin.js'), ssr: false, options: { - swURL: fixUrl(`${routerBase}/${swFileName}`), + swURL: fixUrl(swURL), swScope: fixUrl(`${routerBase}/`) } })