Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
85 lines (84 loc) · 1.88 KB
/
Copy pathvite.config.js
File metadata and controls
85 lines (84 loc) · 1.88 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
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import pkg from './package.json' with { type: 'json' }
export default defineConfig({
base: '/markon/',
define: {
'import.meta.env.VERSION': JSON.stringify(pkg.version),
},
server: {
watch: {
ignored: ['**/*.tmp', '**/.dev/**', '**/.git/**', '**/.github/**', '**/node_modules/**', '**/dist/**'],
},
},
plugins: [
VitePWA({
registerType: 'autoUpdate',
workbox: {
clientsClaim: true,
skipWaiting: true,
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5MB limit
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2,woff,ttf}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/.*\.woff2?$/i,
handler: 'CacheFirst',
options: {
cacheName: 'font-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year
},
},
},
],
},
includeAssets: [
'logo.png',
'wordmark.png',
'wordmark-bw.png',
'drag-handle.svg',
'wordmark-font.svg',
'wordmark.svg',
'icon-192.png',
'icon-512.png',
'icon-maskable-512.png',
'apple-touch-icon.png',
],
manifest: {
name: 'markon',
short_name: 'markon',
description: 'Minimal distraction-free live Markdown editor',
theme_color: '#100010',
background_color: '#e2e2ee88',
display: 'standalone',
orientation: 'portrait-primary',
scope: '/markon/',
start_url: '/markon/',
icons: [
{
src: 'icon-192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any',
},
{
src: 'icon-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: 'icon-maskable-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
devOptions: {
enabled: true,
},
}),
],
})