• English
  • Interface: SharedSwConfig

    Extended by

    Properties

    filename?

    optional filename: string

    Default Value

    "sw.js"

    include?

    optional include: string[] | (assets, initialAssets) => string[]

    This array (or the array returned by the callback) is passed directly to workbox's globPatterns. By default all assets bundled by rsbuild are included (except the ones that match *.map or *.LICENSE.txt patterns) plus the sw registration script and the web app manifest

    Examples

    ["**/*.{js,wasm,css,html}"]
    (assets) => [...assets.map(asset => asset), "**/*.{ico,svg,png}"]
    // initialAssets is the assets before "*.map" and other patterns (see above) were filtered out
    (_assets, initialAssets) => initialAssets

    includeWebAppManifestIcons?

    optional includeWebAppManifestIcons: boolean | number[]

    should precache the icons defined in WebAppManifestConfig? it can be a boolean or an array of the icons' indexes that should be precached.

    Examples

    true
    [0, 1]