-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
113 lines (108 loc) · 2.7 KB
/
vite.config.ts
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
output: {
manualChunks: {
react: ['react'],
rDom: ['react-dom'],
fm: ['framer-motion'],
},
},
},
},
plugins: [
react(),
tsconfigPaths(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
registerType: 'autoUpdate',
injectRegister: false,
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,jpg,jpeg,gif}'],
runtimeCaching: [
{
urlPattern: /\.(png|jpg|jpeg|gif|svg)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'image-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
pwaAssets: {
disabled: true,
config: true,
overrideManifestIcons: false,
},
manifest: {
name: 'sunoh',
short_name: 'Sunoh',
description: 'Sunoh dil ki dhun',
theme_color: '#0a0a0a',
background_color: '#0a0a0a',
start_url: '/',
icons: [
{
purpose: 'maskable',
sizes: '1024x1024',
src: 'maskable_icon.png',
type: 'image/png',
},
{
purpose: 'maskable',
sizes: '72x72',
src: 'maskable_icon_x72.png',
type: 'image/png',
},
{
purpose: 'maskable',
sizes: '96x96',
src: 'maskable_icon_x96.png',
type: 'image/png',
},
{
purpose: 'any',
sizes: '144x144',
src: 'maskable_icon_x144.png',
type: 'image/png',
},
{
purpose: 'maskable',
sizes: '192x192',
src: 'maskable_icon_x192.png',
type: 'image/png',
},
{
purpose: 'maskable',
sizes: '512x512',
src: 'maskable_icon_x512.png',
type: 'image/png',
},
],
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,svg,png,ico}'],
},
devOptions: {
enabled: false,
navigateFallback: 'index.html',
suppressWarnings: true,
type: 'module',
},
}),
],
});