Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (41 loc) · 1.58 KB
/
Copy pathvite.config.ts
File metadata and controls
43 lines (41 loc) · 1.58 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
// GitHub Pages project sites are served from /<repo>/, so assets need that
// prefix. Override with BASE_PATH=/ if you ever move to a custom domain.
const base = process.env.BASE_PATH ?? '/dateideas/'
export default defineConfig({
base,
plugins: [
react(),
tailwindcss(),
VitePWA({
// 'prompt', not 'autoUpdate': autoUpdate can reload the page out from
// under you mid-sentence. This shows a pill instead and lets you choose
// the moment — with an update check on every focus, so it appears within
// seconds of a deploy rather than whenever the browser feels like it.
registerType: 'prompt',
// public/manifest.webmanifest is already written and linked by hand.
manifest: false,
includeAssets: [
'favicon.svg',
'apple-touch-icon.png',
'icon-192.png',
'icon-512.png',
'icon-maskable-512.png',
'manifest.webmanifest',
],
workbox: {
// woff2: the fonts are bundled now, and precaching them is what lets
// the pixel type render offline.
globPatterns: ['**/*.{js,css,html,svg,png,webmanifest,woff2}'],
navigateFallback: 'index.html',
cleanupOutdatedCaches: true,
// Deliberately no runtimeCaching. Firestore keeps its own offline
// cache, and map tiles must never be served stale — a cached map is
// worse than an honest blank one.
},
}),
],
})