tessl install tessl/npm-workbox-webpack-plugin@7.3.0A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
Agent Success
Agent success rate when using this tile
80%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
67%
Design a build helper that produces a precache-ready service worker. It should let consumers opt into compiling the worker source (including extra compilation plugins) or fall back to copying the source as-is while still emitting clear warnings about ignored compilation options.
@generates
export interface ServiceWorkerBuildOptions {
/** Path to the source service worker file */
swSrc: string;
/** Destination filename for the emitted service worker */
swDest: string;
/** Whether to compile the source through a bundler pipeline */
compile: boolean;
/** Additional bundler plugins applied only during service worker compilation */
compilationPlugins?: any[];
/** The parent webpack compiler used to share context and filesystem */
parentCompiler: import('webpack').Compiler;
/** Optional hook for surfaced warnings */
warn?: (message: string) => void;
}
export interface BuildResult {
/** Absolute path to the emitted service worker */
swOutputPath: string;
/** Any warnings raised during the build */
warnings: string[];
}
/**
* Builds or copies the service worker based on the provided options.
*/
export function buildServiceWorker(options: ServiceWorkerBuildOptions): Promise<BuildResult>;Provides the manifest-injection tooling needed to emit the final service worker with its precache manifest.