Files
mao1/PWA/vite.config.ts

44 lines
993 B
TypeScript
Raw Normal View History

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
server: {
proxy: {
'/api': 'http://localhost:3001',
'/memory': 'http://localhost:3001',
'/push': 'http://localhost:3001',
},
},
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
manifest: {
name: 'Elec',
short_name: 'Elec',
description: '多模型AI对话',
theme_color: '#000000',
background_color: '#000000',
display: 'standalone',
orientation: 'portrait',
icons: [
{
src: '/icon-192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/icon-512.png',
sizes: '512x512',
type: 'image/png'
}
]
}
})
]
})