CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-workbox-webpack-plugin

A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.

Overall
score

80%

Overview
Eval results
Files

task.mdevals/scenario-8/

Filtered Precache Build Helper

Configure a webpack build helper that emits a service worker with a precache manifest limited to approved assets and URLs.

Capabilities

Filters assets by chunk and extension

  • When the build outputs hashed .js and .css files for chunks named app and vendor, the precache manifest contains those URLs with revisions while excluding any admin chunk files and .map assets. @test

Enforces precache size ceiling

  • Assets larger than the provided byte limit are omitted from the precache manifest while smaller assets remain. @test

Uses provided public paths

  • Public URLs in the precache manifest honor the configured publicPath, including trailing slash handling, and do not duplicate slashes. @test

Implementation

@generates

API

/**
 * Creates a webpack plugin instance that generates a service worker with a filtered precache manifest.
 *
 * @param {Object} options
 * @param {string} options.publicPath - Base URL prefix applied to manifest entries.
 * @param {string[]} options.allowedChunks - Chunk names to include in precaching (e.g., ["app", "vendor"]).
 * @param {string[]} [options.deniedChunks] - Chunk names to exclude even if present in the build.
 * @param {number} options.maxFileSizeBytes - Maximum file size allowed for precached assets.
 * @returns {any} Configured plugin ready to be added to a webpack config.
 */
export function createFilteredPrecachePlugin(options);

Dependencies { .dependencies }

workbox-webpack-plugin { .dependency }

Provides build-time generation of service workers with asset discovery, filtering, and precache manifest output.

Install with Tessl CLI

npx tessl i tessl/npm-workbox-webpack-plugin

tile.json