我的配置看起来像这样:
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 ...