-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathgenerate-manifest.js
47 lines (47 loc) · 1.19 KB
/
generate-manifest.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
module.exports = (options) => {
const { name, theming, bundler } = options;
const iconsFolder = bundler ? 'icons' : 'assets/icons';
const manifest = {
name,
short_name: name,
description: name,
lang: 'en-US',
start_url: '/',
display: 'standalone',
background_color: theming.customColor && theming.color ? `${theming.color}` : '#EE350F',
theme_color: theming.customColor && theming.color ? `${theming.color}` : '#EE350F',
icons: [
{
src: `/${iconsFolder}/128x128.png`,
sizes: '128x128',
type: 'image/png',
},
{
src: `/${iconsFolder}/144x144.png`,
sizes: '144x144',
type: 'image/png',
},
{
src: `/${iconsFolder}/152x152.png`,
sizes: '152x152',
type: 'image/png',
},
{
src: `/${iconsFolder}/192x192.png`,
sizes: '192x192',
type: 'image/png',
},
{
src: `/${iconsFolder}/256x256.png`,
sizes: '256x256',
type: 'image/png',
},
{
src: `/${iconsFolder}/512x512.png`,
sizes: '512x512',
type: 'image/png',
},
],
};
return JSON.stringify(manifest, null, 2);
};