English
PWAPluginContext
Interface @unplugin-pwa/core/context-typesProperties
| Property | Type | Default | Description |
|---|---|---|---|
base | string | ||
build | PWABuildContext | ||
bundler | B | ||
consumerOptions | Partial<VitePWAOptions<UserStrategy, T>> | ||
customPwaAssetResolver | CustomPwaAssetResolver | The custom resolver to resolve PWA assets for registerSW.js and virtual PWA modules. | |
dev | PWABuildDevContext<B, T> | ||
devEnvironment | boolean | ||
externalConfigurationLoader | boolean | ||
hmrRequiresSwitcher? | true | ||
hooks | Hookable<PWAHooks> | ||
injectManifestSWAtPublicDir | () => boolean | When using inject-manifest this hook will resolve if the service worker is inside public directory.Integrations can override this hook, for example, Vite integration will check the publicDir, or Nuxt will check Nitro public dirs. | |
isPreview | boolean | ||
outDir | string | ||
publicDir | string | ||
pwaAssetsGenerator | Promise<PWAAssetsGenerator | undefined> | ||
registerSWData | () => Promise<RegisterSWData & { module: boolean } | undefined> | How the service worker is being registered in the application. This option will help some integrations to inject the corresponding script in the head. | |
resolvedOptions | Partial<ResolvedVitePWAOptions<ExtractStrategy<UserStrategy>, T>> | ||
rootDir | string | ||
runBuild | () => Promise<boolean | BuildResult> | ||
sources | Set<string> | ||
strategy | ExtractStrategy<UserStrategy> | ||
swNames | SWNames | ||
useImportRegister | boolean | ||
version | string | ||
webManifestData | () => WebManifestData | undefined | Returns the PWA web manifest url for the manifest link: <link rel="manifest" href="<webManifestUrl>" /> Will also return if the manifest will require credentials: <link rel="manifest" href="<webManifestUrl>" crossorigin="use-credentials" /> |