-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
59 lines (58 loc) · 1.54 KB
/
Copy pathvite.config.js
File metadata and controls
59 lines (58 loc) · 1.54 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'
import { VitePWA } from 'vite-plugin-pwa'
import { fileURLToPath, URL } from 'node:url'
import manifestJSON from './public/manifest.json' with { type: 'json' }
export default defineConfig({
plugins: [
vue(),
vuetify({
autoImport: true,
}),
VitePWA({
registerType: 'autoUpdate',
manifest: manifestJSON,
workbox: {
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MB
globPatterns: ['**/*.{js,css,html,ico,png,svg,jpg,gif,webp,woff,woff2,ttf,eot}'],
globIgnores: ['**/opencv.js'],
runtimeCaching: [
{
urlPattern: /opencv\.js$/,
handler: 'CacheFirst',
options: {
cacheName: 'opencv-cache',
expiration: {
maxEntries: 1,
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year
},
},
},
{
urlPattern: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts',
expiration: {
maxEntries: 30,
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
base: '/',
build: {
outDir: 'docs',
},
})