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-7/

Service Worker Precache Guard

A build helper that configures service worker generation to stay safe during repeated webpack builds.

Capabilities

Excludes generated assets from precache

  • When building, the precache manifest omits the service worker file and any manifest/runtime chunks emitted by the plugin itself, even though they appear in compilation assets. @test

Warns on repeated invocation

  • Running the plugin more than once in the same compiler lifecycle triggers a single warning that stale precache data may be produced. @test

Tracks prior plugin outputs across builds

  • During watch-mode rebuilds, the plugin remembers any asset names it emitted previously and excludes them from the next manifest without relying on external storage, preventing self-precaching. @test

Implementation

@generates

API

/**
 * Returns a configured build plugin that generates a precaching service worker
 * while guarding against self-precaching when builds rerun.
 *
 * @param {object} options
 * @param {string} options.swDest Absolute or output-relative path for the service worker bundle.
 * @param {string} [options.publicPath] Base URL for emitted assets.
 * @param {boolean} [options.watchMode] Indicates the compiler runs in watch mode.
 * @returns {object} A webpack-compatible plugin instance ready to be added to a config.
 */
function createSwPlugin(options) {}

Dependencies { .dependencies }

workbox-webpack-plugin { .dependency }

Generates a service worker with precache and runtime caching support for webpack builds.

Install with Tessl CLI

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

tile.json