CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-workbox-webpack-plugin

tessl install tessl/npm-workbox-webpack-plugin@7.3.0

A 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%

task.mdevals/scenario-1/

Custom Precache Service Worker Build

A build helper that outputs a final service worker by merging a developer-authored source file with a generated precache manifest derived from bundler assets.

Capabilities

Manifest injection into custom service worker

  • Emits a service worker that replaces a manifest placeholder with entries for hashed bundle assets discovered during the build, using the provided destination path inside the distribution directory. @test

Service worker compilation support

  • Compiles the service worker source with the bundler pipeline (supporting module imports) before manifest injection and writes the compiled file to the configured destination. @test

Custom manifest entries and filtering

  • Adds caller-specified additional URLs (with optional revisions) to the precache manifest and omits any assets matching exclusion patterns such as source maps. @test

Chunk script imports without precache

  • Accepts a list of chunk names whose emitted scripts are imported by the service worker while being excluded from the precache manifest. @test

Implementation

@generates

API

/**
 * Builds a custom service worker with an injected precache manifest produced from bundler assets.
 */
export interface SwBuildOptions {
  swSrc: string;
  swDest?: string;
  assetsDir: string;
  publicPath?: string;
  additionalEntries?: Array<{ url: string; revision?: string | null }>;
  exclude?: Array<string | RegExp>;
  chunkScripts?: string[];
}

export async function buildServiceWorker(options: SwBuildOptions): Promise<{
  swPath: string;
  manifest: Array<{ url: string; revision: string | null }>;
}>;

Dependencies { .dependencies }

workbox-webpack-plugin { .dependency }

Custom service worker injection during bundling and precache manifest generation. @satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/workbox-webpack-plugin@7.3.x
tile.json