fix(projects): fix vite-pwa plugin config

This commit is contained in:
Soybean
2022-11-14 21:39:55 +08:00
parent 436b15f010
commit 94098d02e8
3 changed files with 34 additions and 3 deletions

31
build/plugins/pwa.ts Normal file
View File

@ -0,0 +1,31 @@
import { VitePWA } from 'vite-plugin-pwa';
export default function setupVitePwa() {
return VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico'],
manifest: {
name: 'SoybeanAdmin',
short_name: 'SoybeanAdmin',
theme_color: '#fff',
icons: [
{
src: '/logo.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/logo.png',
sizes: '512x512',
type: 'image/png'
},
{
src: '/logo.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable'
}
]
}
});
}