Skip to content

injectGenerateRegisterSW ​

Function @unplugin-pwa/core/inject-generate-register-sw
ts
injectGenerateRegisterSW(html: string, ctx: PWAPluginContext<any, any, any>, dev: boolean, injectAtDev: boolean): Promise<string | undefined>

Adds the registerSW.js script to the HTML entry point.

Parameters ​

  • html – The HTML entry point.

  • ctx – The PWA Context.

  • dev – For dev server

  • injectAtDev – Inject the script at dev server?

Released under the MIT License.