我正在设置用于生成服务工作器的自定义配置。我正在使用injectManifest。问题是我的资产已部署到具有与应用程序运行不同的域的s3存储桶。
我已经阅读了所有文档,但尚未找到任何配置选项。
const buildSW = () => {
// This will return a Promise
return workboxBuild
.injectManifest({
swSrc: 'src/sw-template.js',
swDest: 'build/sw.js', // this will be created in the build step
globDirectory: 'build',
globPatterns: ['**\/*.{js, html}'],
})
.then(({ count, size, warnings }) => {
// Optionally, log any warnings and details.
warnings.forEach(console.warn);
console.log(`${count} files will be precached, totaling ${size} bytes.`);
});
};
buildSW();
我收到类似的配置:
"url": "static/js/runtime~main.ccae3505.js",
"revision": "51731239672d142923190a6cfb73ce8b"
},
但是想要类似的东西>
"url": "https://myCustomDomain.com/static/js/runtime~main.ccae3505.js",
"revision": "51731239672d142923190a6cfb73ce8b"
},```
我正在设置用于生成服务工作器的自定义配置。我正在使用injectManifest。问题是我的资产已部署到具有与应用程序运行不同的域的s3存储桶。我读过...
我发现了它-希望它对某人有用:manifestTransforms
可以解决问题