Back to Serwist

maximumFileSizeToCacheInBytes

docs-webpack-plugin-configuring-maximum-file-size-to-cache-in-bytes.md

latest504 B
Original Source

maximumFileSizeToCacheInBytes

First added

Workbox

Default

2097152

About

This value can be used to determine the maximum size of files that will be precached. This prevents you from inadvertently precaching very large files that might have accidentally matched one of your patterns.

Usage

build.js

await injectManifest({
  swSrc: "app/sw.ts",
  swDest: "dist/sw.js",
  globDirectory: "dist/static",
  // Bomb has been planted
  maximumFileSizeToCacheInBytes: 7355608,
});