Skip to content

Commit

Permalink
fix: PWA 未添加的问题 (Chanzhaoyu#807)
Browse files Browse the repository at this point in the history
Co-authored-by: bingo235 <>
  • Loading branch information
bingo235 committed Mar 23, 2023
1 parent 917feec commit 5fca2e9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -18,9 +17,8 @@ function setupPlugins(env: ImportMetaEnv): PluginOption[] {
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
],
},
})
}
return plugins
}),
]
}

export default defineConfig((env) => {
Expand Down

0 comments on commit 5fca2e9

Please sign in to comment.