-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
94 lines (94 loc) · 3.5 KB
/
vite.config.js
File metadata and controls
94 lines (94 loc) · 3.5 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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
import { fileURLToPath, URL } from 'node:url';
// https://vitejs.dev/config/
export default defineConfig({
base: '/WeatherVue/',
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'robots.txt', 'apple-touch-icon.png'],
manifest: {
name: 'WeatherVue',
short_name: 'WeatherVue',
description: 'Award-winning weather application with immersive atmospheric design',
theme_color: '#000000',
background_color: '#000000',
display: 'standalone',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
}
]
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/api\.open-meteo\.com\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'weather-api-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 5 // 5 minutes
},
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/geocoding-api\.open-meteo\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'geocoding-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 7 // 1 week
}
}
}
]
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
'@composables': fileURLToPath(new URL('./src/composables', import.meta.url)),
'@stores': fileURLToPath(new URL('./src/stores', import.meta.url)),
'@services': fileURLToPath(new URL('./src/services', import.meta.url)),
'@types': fileURLToPath(new URL('./src/types', import.meta.url)),
'@utils': fileURLToPath(new URL('./src/utils', import.meta.url))
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
'three': ['three'],
'd3': ['d3'],
'gsap': ['gsap'],
'vendor': ['vue', 'vue-router', 'pinia']
}
}
}
}
});