-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
112 lines (110 loc) · 2.99 KB
/
Copy pathvite.config.js
File metadata and controls
112 lines (110 loc) · 2.99 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
110
111
112
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
const buildDate = new Date().toISOString();
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'prompt',
includeAssets: [
'icon.svg',
'pwa-64x64.png',
'pwa-192x192.png',
'apple-touch-icon.png',
'pwa-512x512.png',
],
manifest: {
name: 'Really Safe Skiing',
short_name: 'Really Safe Skiing',
description:
'A low-poly, high-speed downhill skiing game where safety is strictly... optional. Dodge trees, rocks, and gravity itself.',
theme_color: '#ffffff',
background_color: '#ffffff',
display: 'standalone',
icons: [
{
src: 'pwa-64x64.png',
sizes: '64x64',
type: 'image/png',
},
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'apple-touch-icon.png',
sizes: '180x180',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
workbox: {
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // allow larger physics chunk
globPatterns: ['**/*.{js,css,html,ico,png,svg,wasm,woff2,woff,ttf}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'gstatic-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
}),
],
define: {
'import.meta.env.VITE_BUILD_DATE': JSON.stringify(buildDate),
},
build: {
// chunkSizeWarningLimit: 1600,
rollupOptions: {
output: {
manualChunks: {
// Split heavy physics engine into its own file
physics: ['@dimforge/rapier3d-compat'],
// Split 3D engine into its own file
three: ['three'],
// Others
vendor: [
'react',
'react-dom',
'zustand',
'lucide-react',
'clsx',
'simplex-noise',
'tailwind-merge',
],
},
},
},
},
});