From 5fca2e9fa306e46e1813b7198b361176b7e9bd41 Mon Sep 17 00:00:00 2001 From: Bing Date: Thu, 23 Mar 2023 15:55:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PWA=20=E6=9C=AA=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: bingo235 <> --- vite.config.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 5ce7ac4..ff0cdae 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) => {