forked from oskarrough/slaytheweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
65 lines (63 loc) · 1.69 KB
/
vite.config.js
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
import {resolve} from 'path'
import {defineConfig} from 'vite'
import {VitePWA} from 'vite-plugin-pwa'
import {execSync} from 'child_process'
export default defineConfig(() => {
process.env.VITE_GIT_HASH = execSync('git rev-parse HEAD').toString().trimEnd()
process.env.VITE_GIT_MESSAGE = execSync('git show -s --format=%s').toString().trimEnd()
return {
build: {
target: 'esnext',
rollupOptions: {
input: {
index: resolve('index.html'),
collection: resolve('collection.html'),
stats: resolve('stats.html'),
text: resolve('text.html'),
manual: resolve('manual.html'),
mapDemo: resolve('map-demo.html'),
},
},
},
plugins: [
VitePWA({
// base: '/',
// How to register the sw
// injectRegister: 'script', // or 'inline'
// Whether to update automatically, or prompt for an update
// registerType: 'prompt',
workbox: {
globPatterns: ['**/*.{html,css,js,json,svg,png,ico,webp,woff,woff2,wasm}'],
},
// Enable in dev server
// devOptions: {
// enabled: true
// },
// The actual webmanifest
manifest: {
name: 'Slay the Web',
short_name: 'Slay the Web',
description:
'a singleplayer, deck builder, roguelike card crawl game for the web based on Slay the Spire',
start_url: '/index.html',
display: 'fullscreen',
orientation: 'landscape',
background_color: '#116f54',
theme_color: '#116f54',
icons: [
{
src: '/images/favicons/favicon-192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/images/favicons/favicon-512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
}),
],
}
})