-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpwa-assets.config.ts
66 lines (64 loc) · 1.75 KB
/
pwa-assets.config.ts
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
import {
combinePresetAndAppleSplashScreens,
defineConfig,
Preset,
} from '@vite-pwa/assets-generator/config';
const defaultPreset: Preset = {
transparent: {
sizes: [32, 64, 192, 512],
favicons: [
[32, 'favicon-32x32.ico'],
[48, 'favicon-48x48.ico'],
[64, 'favicon.ico'],
[72, 'favicon-72x72.ico'],
[96, 'favicon-96x96.ico'],
[128, 'favicon-128x128.ico'],
],
},
maskable: {
sizes: [512],
},
apple: {
sizes: [180],
},
};
export default defineConfig({
// injectThemeColor: true,
images: ['public/vite.svg'],
/* remember to include the preset for favicons and apple touch icon */
headLinkOptions: {
preset: '2023',
},
preset: combinePresetAndAppleSplashScreens(defaultPreset, {
padding: 0.3,
resizeOptions: {
background: 'white',
fit: 'contain',
},
// by default, dark splash screens are exluded
darkResizeOptions: {
background: 'black',
},
linkMediaOptions: {
// will log the links you need to add to your html pages
log: true,
// add screen to media attribute link?
// by default:
// <link rel="apple-touch-startup-image" href="..." media="screen and ...">
addMediaScreen: true,
// add closing link tag?
// by default:
// <link rel="apple-touch-startup-image" href="..." media="...">
// with xhtml enabled:
// <link rel="apple-touch-startup-image" href="..." media="..." />
xhtml: false,
},
png: {
compressionLevel: 9,
quality: 90,
},
name: (landscape, size, dark) => {
return `apple-splash-${landscape ? 'landscape' : 'portrait'}-${typeof dark === 'boolean' ? (dark ? 'dark-' : 'light-') : ''}${size.width}x${size.height}.png`;
},
}),
});