build: add a flag VITE_APP_ENABLE_PWA for enabling pwa in dev environment (#8784)

* build: add a flag VITE_APP_ENABLE_PWA for enabling pwa in dev environment

* fix

* set VITE_ENABLE_PWA to false in .env.development
This commit is contained in:
Aakansha Doshi 2024-11-09 21:45:37 +05:30 committed by GitHub
parent ef9ea14a75
commit ee091d0dbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -29,6 +29,9 @@ interface ImportMetaEnv {
// Enable eslint in dev server
VITE_APP_ENABLE_ESLINT: string;
// Enable PWA in dev server
VITE_APP_ENABLE_PWA: string;
VITE_APP_PLUS_LP: string;
VITE_APP_PLUS_APP: string;

View file

@ -80,7 +80,7 @@ export default defineConfig(({ mode }) => {
registerType: "autoUpdate",
devOptions: {
/* set this flag to true to enable in Development mode */
enabled: false,
enabled: envVars.VITE_APP_ENABLE_PWA === "true",
},
workbox: {
@ -169,6 +169,7 @@ export default defineConfig(({ mode }) => {
},
],
start_url: "/",
id:"excalidraw",
display: "standalone",
theme_color: "#121212",
background_color: "#ffffff",