vite-plugin-pwa: enable dev sw for not production

This commit is contained in:
thislight 2024-10-24 16:00:19 +08:00
parent 20163dcb8e
commit a0cbf857a9

View file

@ -64,7 +64,7 @@ export default defineConfig(({ mode }) => ({
strategies: "injectManifest", strategies: "injectManifest",
registerType: "autoUpdate", registerType: "autoUpdate",
devOptions: { devOptions: {
enabled: mode === "staging" || mode === "dev", enabled: mode !== "production",
}, },
srcDir: "src/serviceworker", srcDir: "src/serviceworker",
filename: "main.ts", filename: "main.ts",