From 1d71e357ff9c20af233f177bffff11903069a528 Mon Sep 17 00:00:00 2001 From: bingo235 <> Date: Thu, 23 Mar 2023 15:22:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:PWA=E6=9C=AA=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 5ce7ac4eae..ff0cdae736 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,10 +5,9 @@ import vue from '@vitejs/plugin-vue' import { VitePWA } from 'vite-plugin-pwa' function setupPlugins(env: ImportMetaEnv): PluginOption[] { - const plugins = [vue()] - - if (env.VITE_GLOB_APP_PWA === 'true') { - VitePWA({ + return [ + vue(), + env.VITE_GLOB_APP_PWA === 'true' && VitePWA({ injectRegister: 'auto', manifest: { name: 'chatGPT', @@ -18,9 +17,8 @@ function setupPlugins(env: ImportMetaEnv): PluginOption[] { { src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' }, ], }, - }) - } - return plugins + }), + ] } export default defineConfig((env) => {