• English
  • Interface: InjectManifestModeConfig

    Extends

    Properties

    filename?

    optional filename: string

    Default Value

    "sw.js"

    Inherited from

    SharedSwConfig.filename


    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

    Inherited from

    SharedSwConfig.include


    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]

    Inherited from

    SharedSwConfig.includeWebAppManifestIcons


    minify?

    optional minify: boolean


    mode

    mode: "injectManifest"


    srcFile

    srcFile: string

    path to your sw relative to the project root

    Examples

    path.join("src", "my-sw.js")
    "/home/user/my-project/src/sw.ts"

    workboxOptions?

    optional workboxOptions: WorkboxInjectManifestOptions