Skip to content

RegisterSWData ​

Interface unplugin-pwa-core

Properties ​

PropertyTypeDefaultDescription
inlinebooleanWhen this flag is true the service worker must be registered via inline script otherwise registered via script with src attribute registerSW.js.
inlinePathstringThe path for the inline script: will contain the service worker url.
mode"inline" | "script" | "script-defer"When this flag is inline the service worker must be registered via inline script otherwise registered via script with src attribute registerSW.js.
registerPathstringThe path for the src script for registerSW.js.
scopestringThe scope for the service worker: only required for inline: true.
shouldRegisterSWboolean
toScriptTag() => string | undefinedReturns the corresponding script tag if shouldRegisterSW returns true.
typeWorkerTypeThe type for the service worker: only required for inline: true.

Released under the MIT License.