-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
109 lines (107 loc) · 2.68 KB
/
vite.config.ts
File metadata and controls
109 lines (107 loc) · 2.68 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
97
98
99
100
101
102
103
104
105
106
107
108
109
import tailwindcss from '@tailwindcss/vite'
import viteReact from '@vitejs/plugin-react'
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3000,
host: true,
allowedHosts: ['xn--b1aydi0d.xn--p1ai'],
},
preview: {
port: 3000,
host: true,
allowedHosts: ['xn--b1aydi0d.xn--p1ai'],
},
plugins: [
tanstackRouter({
target: 'react',
autoCodeSplitting: true,
}),
viteReact(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'logo.png', 'logo.svg'],
manifest: {
name: 'Events & Opportunities',
short_name: 'EvOps',
description: 'Платформа событий и возможностей',
theme_color: '#000000',
background_color: '#ffffff',
display: 'standalone',
scope: '/',
start_url: '/',
orientation: 'portrait-primary',
icons: [
{
src: 'logo.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any',
},
{
src: 'logo.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: 'logo.png',
sizes: '192x192',
type: 'image/png',
purpose: 'maskable',
},
{
src: 'logo.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
workbox: {
clientsClaim: true,
skipWaiting: true,
globPatterns: [
'**/*.{js,css,html,json,svg,png,woff2,woff,ttf,eot,ico}',
],
runtimeCaching: [
{
urlPattern: /^https:\/\/api\./,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 24 * 60 * 60, // 24 hours
},
},
},
{
urlPattern: /\.(png|jpg|jpeg|svg|gif)$/,
handler: 'CacheFirst',
options: {
cacheName: 'image-cache',
expiration: {
maxEntries: 200,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
},
},
},
],
},
devOptions: {
enabled: true,
},
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
})