diff --git a/src/options.ts b/src/options.ts index 23b61617..d50faea6 100644 --- a/src/options.ts +++ b/src/options.ts @@ -125,6 +125,7 @@ export async function resolveOptions(ctx: PWAPluginContext): Promise + + /** + * Environment options. + * + * @since v0.19.6 + */ + envOptions?: { + /** + * Configure Vite `envDir` option. + * + * @default Vite `envDir`. + */ + envDir?: UserConfig['envDir'] + /** + * Configure Vite `envPrefix` option. + * + * @default Vite `envPrefix`. + */ + envPrefix?: UserConfig['envPrefix'] + } } export interface PWAIntegration { @@ -94,6 +114,14 @@ export interface PWAIntegration { viteOptions: ResolvedConfig, options: Partial, ) => void | Promise + /** + * Allow integrations to configure Vite options for custom service worker build. + * + * @param options Vite options for custom service worker build. + * @see src/vite-build.ts module + * @since v0.19.6 + */ + configureCustomSWViteBuild?: (options: InlineConfig) => void | Promise } /** @@ -388,6 +416,10 @@ export interface ResolvedVitePWAOptions extends Required