63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.svg', 'robots.txt'],
|
|
manifest: {
|
|
name: 'Luxe Directory',
|
|
short_name: 'Luxe',
|
|
description: 'Premium companion directory platform',
|
|
theme_color: '#0A0A0B',
|
|
background_color: '#0A0A0B',
|
|
display: 'standalone',
|
|
icons: [
|
|
{ src: '/favicon.svg', sizes: 'any', type: 'image/svg+xml' },
|
|
],
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/api\./i,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
expiration: { maxEntries: 100, maxAgeSeconds: 86400 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
if (id.includes('@mui') || id.includes('@emotion')) return 'mui';
|
|
if (id.includes('framer-motion')) return 'motion';
|
|
if (id.includes('@tanstack/react-query')) return 'query';
|
|
if (id.includes('react') || id.includes('react-dom') || id.includes('react-router')) return 'vendor';
|
|
}
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
open: false,
|
|
},
|
|
});
|