vite-plugin-pwa: enable production sw for staging

This commit is contained in:
thislight 2024-10-24 23:50:57 +08:00
parent f8dc2950d2
commit 88731c07b7

View file

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