vite: precache images for pwa

This commit is contained in:
thislight 2024-10-27 14:19:56 +08:00
parent 4734a67f5a
commit c06d8b8c11
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E

View file

@ -76,7 +76,7 @@ export default defineConfig(({ mode }) => {
strategies: "injectManifest",
registerType: "autoUpdate",
devOptions: {
enabled: !["production", "staging"].includes(mode),
enabled: true,
},
srcDir: "src/serviceworker",
filename: "main.ts",
@ -84,6 +84,9 @@ export default defineConfig(({ mode }) => {
pwaAssets: {
config: true,
},
injectManifest: {
globPatterns: ["**/*.{js,wasm,css,html,svg,png,ico}"],
},
}),
version(),
],