53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.svg', 'icons.svg'],
|
|
manifest: {
|
|
name: 'ERP System',
|
|
short_name: 'ERP',
|
|
description: '跨平台ERP系统',
|
|
theme_color: '#ffffff',
|
|
start_url: '/',
|
|
icons: [
|
|
{
|
|
src: 'icons.svg',
|
|
sizes: '192x192',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: 'icons.svg',
|
|
sizes: '512x512',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}']
|
|
}
|
|
})
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom') || id.includes('node_modules/react-router-dom')) {
|
|
return 'vendor';
|
|
}
|
|
if (id.includes('node_modules/antd')) {
|
|
return 'antd';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|