我已经用 CRA 创建了 React 应用程序。我想要定制软件。我正在使用workbox-build 和injectManifest 来创建我的SW。但我仍然坚持等待激活 =/ 和 Uncaught SyntaxError: Unexpected token '<'。或者..
如果我使用 sw-template2.js .. 我可以跳过等待.. 但我仍然收到 Uncaught SyntaxError: Unexpected token '<' 和白页,我需要手动刷新页面才能查看内容。有什么建议如何使用该软件顺利更新我的页面吗?
我的registerServiceWorker.js:
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since …Run Code Online (Sandbox Code Playgroud)