Skip to content

Commit

Permalink
perf: do not precache html
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Dec 4, 2023
1 parent 0426612 commit 1dce0a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nitroSWPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,16 @@ export function createNitroSWPreset(config: SWPresetConfig): NitroConfig {
const workboxOptionsBase: GetManifestOptions = {
globDirectory: nitro.options.output.publicDir,
globPatterns: [
"**/*.{js,css,html}",
"**/*.{js,css}",
"**/_payload.json",
"_nuxt/**/*",
// PWA resources
"favicon.svg", // though favicon.ico exists, it will not be used on modern browsers that support PWA
"*.webmanifest",
],
globIgnores: ["assets.*", "server.*.js", "sw.js"],
dontCacheBustURLsMatching:
/\.[\da-f]{8}\.(?:bin|css|js)|[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\.json$/,
};
await workbox.injectManifest({
...workboxOptionsBase,
Expand Down

0 comments on commit 1dce0a5

Please sign in to comment.