-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-favicons.js
52 lines (48 loc) · 1.17 KB
/
generate-favicons.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
/* eslint-disable no-shadow */
const favicons = require("favicons");
const fs = require("fs");
const path = require("path");
const config = require("./site-config");
favicons(
path.join(__dirname, "./src/images/kite.png"),
{
path: "/icons/",
appName: config.title,
appShortName: config.title,
appDescription: config.description,
developerName: config.title,
developerURL: config.url,
background: config.theme,
theme_color: config.theme,
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: false,
windows: true,
yandex: false,
},
logging: true,
},
(error, { files, images }) => {
if (error) {
console.error(error.message);
}
images.forEach((image) => {
fs.writeFile(
path.resolve(__dirname, "./public/icons", image.name),
image.contents,
(error) => error && console.error(error),
);
});
files.forEach((file) => {
fs.writeFile(
path.resolve(__dirname, "./public", file.name),
file.contents,
(error) => error && console.error(error),
);
});
},
);