-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (38 loc) · 1.18 KB
/
vite.config.ts
File metadata and controls
39 lines (38 loc) · 1.18 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/',
plugins: [
tailwindcss(),
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg'],
manifest: {
name: 'Squarify',
short_name: 'Squarify',
description: 'Pad photos to a uniform aspect ratio',
theme_color: '#4f46e5',
background_color: '#f9fafb',
display: 'standalone',
start_url: '/',
icons: [
{ src: '/favicon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any maskable' },
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,svg,png,woff2}'],
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024, // 3 MB for libheif-js WASM
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: { cacheName: 'google-fonts-cache', expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 365 } },
},
],
},
}),
],
})