mirror of
https://github.com/ElppaDev/snStatus.git
synced 2026-01-29 17:45:37 +00:00
최초 배포
This commit is contained in:
70
frontend/vite.config.js
Normal file
70
frontend/vite.config.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
VitePWA({
|
||||
strategies: 'injectManifest',
|
||||
srcDir: 'src',
|
||||
filename: 'sw-custom.js',
|
||||
registerType: 'autoUpdate',
|
||||
injectRegister: 'auto',
|
||||
devOptions: {
|
||||
enabled: false
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff,woff2}'],
|
||||
// Simplified for faster builds
|
||||
maximumFileSizeToCacheInBytes: 3000000
|
||||
},
|
||||
includeAssets: ['pwa-192x192.png', 'pwa-512x512.png'],
|
||||
manifest: {
|
||||
name: 'snStatus',
|
||||
short_name: 'snStatus',
|
||||
theme_color: '#1e3a8a',
|
||||
background_color: '#1e3a8a', // Deep Navy for splash
|
||||
display: 'standalone',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: 'pwa-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'pwa-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'any maskable'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
],
|
||||
build: {
|
||||
// Optimize for faster builds on NAS
|
||||
sourcemap: false, // Disable source maps
|
||||
minify: 'esbuild', // Use faster esbuild minifier
|
||||
target: 'es2015', // Less transformation needed
|
||||
cssCodeSplit: false, // Single CSS file
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: undefined // Disable code splitting for faster build
|
||||
}
|
||||
},
|
||||
chunkSizeWarningLimit: 2000 // Suppress warnings
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
host: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://backend:3001',
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user