-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvite.config.js
146 lines (141 loc) · 3.07 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';
import { imagetools } from 'vite-imagetools';
import { VitePWA } from 'vite-plugin-pwa';
import { plugin as MdPlugin } from 'vite-plugin-markdown';
const iconSize = [32, 72, 96, 128, 144, 152, 192, 256, 384, 512];
const icons = iconSize.map((size) => {
const iconObj = {
src: `./icons/icon-${size}x${size}.png`,
sizes: `${size}x${size}`,
type: 'image/png'
};
if (size === 72) iconObj.purpose = 'maskable';
if (size === 192) iconObj.purpose = 'any';
return iconObj;
});
const screenshots = [
{
sizes: '640x360',
src: 'https://i.ibb.co/n74SYpr/sc1.jpg',
label: 'Section 1',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/CPPydzc/sc2.jpg',
label: 'Section 2',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/Q9DgGMN/sc3.jpg',
label: 'Section 3',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/pLNZBv2/sc4.jpg',
label: 'Section 4',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/q7K3vkv/sc5.jpg',
label: 'Section 5',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/34Ddkgp/sc6.jpg',
label: 'Section 6',
type: 'image/jpg'
},
{
sizes: '640x360',
src: 'https://i.ibb.co/LSKRZgC/sc7.jpg',
label: 'Section 7',
type: 'image/jpg'
}
];
const manifest = {
orientation: 'landscape',
name: 'Honkai: Star Rail Warp Simulator',
short_name: 'HSR Warp Sim',
description:
"Just a Realistic Gacha Simulator for Honkai: Star Rail. Let's Simulate your luck unlimited times!",
theme_color: '#000000',
background_color: '#000000',
scope: '/',
start_url: '/?pwasc=hsr-homescreen',
id: 'hsr.wishsimulator.app',
categories: ['games', 'utilities'],
dir: 'auto',
display: 'fullscreen',
handle_links: 'preferred',
icons,
screenshots,
prefer_related_applications: true,
launch_handler: {
client_mode: ['focus-existing, auto']
},
scope_extensions: [
{ origin: 'hsr.wishsimulator.app' },
{ origin: 'hsr-warp-simulator.pages.dev' }
],
display_override: [
'fullscreen',
'window-controls-overlay',
'standalone',
'minimal-ui',
'browser'
],
shortcuts: [
{
name: 'Feedback',
url: '/feedback',
description: 'Give a Comment about the Simulator.'
}
],
edge_side_panel: {
preferred_width: 412
},
related_applications: [
{
platform: 'webapp',
url: 'https://hsr.wishsimulator.app/appmanifest.json'
},
{
platform: 'play',
url: 'https://play.google.com/store/apps/details?id=hsr.wishsimulator.app',
id: 'hsr.wishsimulator.app'
}
]
};
/** @type {import('vite').UserConfig} */
const config = {
plugins: [
imagetools({}),
sveltekit(),
MdPlugin({ mode: 'html' }),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.js',
registerType: 'prompt',
manifestFilename: 'appmanifest.json',
manifest
})
],
resolve: {
alias: {
$post: path.resolve(__dirname, './src/post'),
'@images': path.resolve(__dirname, './src/images')
}
},
build: {
chunkSizeWarningLimit: 350,
target: ['es2020']
}
};
export default config;