This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-window Readme Keywords workbox workboxjs service worker sw window message postMessagePackage Sidebar Install npm i workbox-window Repository github.com/googlechrome/workbox Homepage github.com/Goo...
虽然使用Workbox绝对不需要工具,但如果您的开发基础架构已经包含了与npm依赖项一起使用的webpack或Rollup等打包工具,则可以使用它们来加载Workbox。 第一步就是安装Workbox做为你应用的依赖: npm install workbox-window 然后,在您的某个应用程序的JavaScript文件中,通过引用workbox-window包名称导入Workbox: import {Workb...
npm install workbox-window 1 然后,在您的某个应用程序的 JavaScript 文件中,通过引用 workbox-window 包名称导入 Workbox: import {Workbox} from 'workbox-window'; if ('serviceWorker' in navigator) { const wb = new Workbox('/sw.js'); wb.register(); } 1 2 3 4 5 6 7 如果您的打包工具支...
npm-run-path nth-check nwsapi object-assign object-hash object-inspect object-is object-keys object.assign object.entries object.fromentries object.getownpropertydescriptors object.hasown object.values obuf on-finished on-headers once onetime open optionator p-limit p-locate p-retry...
npm-run-path nth-check nwsapi object-assign object-hash object-inspect object-is object-keys object.assign object.entries object.fromentries object.getownpropertydescriptors object.hasown object.values obuf on-finished on-headers once onetime open optionator p-limit p-locate ...
npm-run-path nth-check nwsapi object-assign object-hash object-inspect object-is object-keys object.assign object.entries object.fromentries object.getownpropertydescriptors object.hasown object.values obuf on-finished on-headers once onetime open optionator p-limit p-locate p...
npm-run-path nth-check nwsapi object-assign object-hash object-inspect object-is object-keys object.assign object.entries object.fromentries object.getownpropertydescriptors object.hasown object.values obuf on-finished on-headers once onetime open optionator p-limit p-locate ...