feat(pwa): add PWA support with auto-update and install prompt
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
This commit is contained in:
@@ -1,10 +1,37 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import packageJson from './package.json'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
plugins: [
|
||||
vue(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: ['favicon.svg'],
|
||||
manifest: {
|
||||
name: 'Tools App',
|
||||
short_name: 'Tools',
|
||||
description: 'A collection of useful tools',
|
||||
theme_color: '#242424',
|
||||
background_color: '#242424',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
icons: [
|
||||
{
|
||||
src: 'favicon.svg',
|
||||
sizes: 'any',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable'
|
||||
}
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}']
|
||||
}
|
||||
})
|
||||
],
|
||||
define: {
|
||||
'__APP_VERSION__': JSON.stringify(packageJson.version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user