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

Chunked Service Worker Imports

Produce configuration for generating a service worker that loads specific named compilation chunks via runtime imports while keeping those chunk assets out of the precache manifest.

Capabilities

Runtime chunk imports

  • Given chunk names ["analytics", "vendor"], the generated service worker imports the JS assets for those chunks at startup and those assets are absent from the precache manifest entries. @test
  • When the same chunk name appears multiple times, the resulting import list contains each chunk only once and preserves the order of first appearance. @test

Missing chunk warnings

  • If a requested chunk name does not exist in the compilation, a warning callback receives that name before service worker generation completes. @test
  • If a requested chunk resolves to no JS assets (for example, only style assets), the warning callback is invoked indicating nothing will be imported for that chunk. @test

Implementation

@generates

API

export function buildChunkImportOptions(chunkNames, options);
/**
 * @param {string[]} chunkNames - Named chunks whose compiled JS assets should be loaded via import scripts at service worker startup.
 * @param {Object} [options]
 * @param {string[]} [options.additionalImports] - Extra scripts (URLs or paths) that must be imported ahead of the chunk assets.
 * @param {(message: string) => void} [options.onWarning] - Called with a human-readable warning when a requested chunk cannot supply a script.
 * @returns {Object} - Configuration object ready to be passed into the service worker bundling plugin.
 */

Dependencies { .dependencies }

workbox-webpack-plugin { .dependency }

Provides the service worker bundling plugin and runtime required to generate a precache manifest and import runtime scripts. @satisfied-by

webpack { .dependency }

Build tool used to produce named chunks referenced by the service worker configuration. @satisfied-by

Version

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