Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
72 lines (71 loc) · 2.29 KB
/
Copy pathvite.config.ts
File metadata and controls
72 lines (71 loc) · 2.29 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
/// <reference types="vitest/config" />
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
build: {
target: 'es2022',
sourcemap: true,
rollupOptions: {
input: {
main: resolve(import.meta.dirname, 'index.html'),
privacy: resolve(import.meta.dirname, 'privacy.html'),
},
},
},
worker: {
format: 'es',
},
plugins: [
VitePWA({
registerType: 'prompt',
injectRegister: null,
includeAssets: ['favicon.ico', 'theme-init.js', 'icons/*.png'],
manifest: {
id: '/',
name: 'Core Keeper Map Tool',
short_name: 'CK Map Tool',
description:
'View your Core Keeper map with boss rings, biome areas, maze holes and a tile finder. Works offline; your map never leaves your device.',
start_url: '/',
scope: '/',
display: 'standalone',
background_color: '#110f0d',
theme_color: '#181613',
categories: ['games', 'utilities'],
icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
{ src: '/icons/maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
file_handlers: [
{
action: '/',
accept: { 'application/gzip': ['.gzip', '.gz'] },
},
],
launch_handler: { client_mode: 'focus-existing' },
} as Record<string, unknown>,
workbox: {
globPatterns: ['**/*.{js,css,html,png,webp,svg,ico,json}'],
navigateFallback: '/index.html',
navigateFallbackDenylist: [/^\/privacy/],
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024,
runtimeCaching: [
{
// The example maps are large: cache them only once someone opens one.
urlPattern: ({ url }) => url.pathname.startsWith('/example/'),
handler: 'CacheFirst',
options: { cacheName: 'example-maps', expiration: { maxEntries: 2 } },
},
],
},
devOptions: { enabled: false },
}),
],
test: {
include: ['tests/unit/**/*.test.ts'],
environment: 'node',
testTimeout: 30000,
},
});