-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
96 lines (95 loc) · 2.77 KB
/
vite.config.ts
File metadata and controls
96 lines (95 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { componentTagger } from "lovable-tagger";
// import { VitePWA } from 'vite-plugin-pwa'; // Temporarily disabled for deployment
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
server: {
host: "0.0.0.0",
port: 8080,
},
preview: {
host: "0.0.0.0",
port: process.env.PORT || 8080,
},
plugins: [
react(),
mode === 'development' && componentTagger(),
// Temporarily disabled PWA plugin for deployment
// VitePWA({
// registerType: 'autoUpdate',
// includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
// manifest: {
// name: 'E Duniya',
// short_name: 'E Duniya',
// description: "Pakistan's premier marketplace for shops, institutes, hospitals, and products",
// theme_color: '#2563eb',
// background_color: '#ffffff',
// display: 'standalone',
// scope: '/',
// start_url: '/',
// icons: [
// {
// src: 'icons/icon-192x192.png',
// sizes: '192x192',
// type: 'image/png'
// },
// {
// src: 'icons/icon-512x512.png',
// sizes: '512x512',
// type: 'image/png'
// }
// ]
// },
// workbox: {
// globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
// runtimeCaching: [
// {
// urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
// handler: 'CacheFirst',
// options: {
// cacheName: 'google-fonts-cache',
// expiration: {
// maxEntries: 10,
// maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
// },
// cacheKeyWillBeUsed: async ({ request }) => {
// return request.url
// }
// }
// },
// {
// urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
// handler: 'CacheFirst',
// options: {
// cacheName: 'images',
// expiration: {
// maxEntries: 60,
// maxAgeSeconds: 30 * 24 * 60 * 60 // 30 Days
// }
// }
// }
// ]
// }
// })
].filter(Boolean),
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: mode === 'development',
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-select', '@radix-ui/react-popover'],
},
},
},
},
}));