“ injectionPointRegexp”在使用工作箱向导时不受支持]] << [

问题描述 投票:0回答:1
根据文档说明,我正在使用Workbox向导创建workbox-config.js:

https://github.com/mikegeyser/workbox-wizardry/blob/master/overview.md#level-2-template-service-worker

我的配置看起来像这样:

module.exports = { "globDirectory": "public/", "globPatterns": [ "**/*.{ico,html,png,json,txt}" ], "swDest": "public/sw.js", "swSrc": "src/sw.js", "injectionPointRegexp": /(const precacheManifest = )\[\](;)/ }

尝试注入清单时出现以下错误:

✘ alxxo@Axxxx  ~/Documents/coda/pwa-xx   workbox ●✚  workbox injectManifest workbox-config.js Using configuration from /xxxxx/workbox-config.js. Your configuration is invalid: { "globDirectory": "public/", "globPatterns": [ "**/*.{ico,html,png,json,txt}" ], "swDest": "public/sw.js", "swSrc": "src/sw.js", "injectionPointRegexp" [1]: {} } [1] "injectionPointRegexp" is not a supported parameter.

如果它出现在文档中,怎么可能不支持该参数?

我正在使用工作箱向导按照文档说明创建workbox-config.js:https://github.com/mikegeyser/workbox-wizardry/blob/master/overview.md#level-2-template-service- worker My ...

workbox
1个回答
0
投票
我假设您使用的是最新版本的Workbox。
© www.soinside.com 2019 - 2024. All rights reserved.