-
Notifications
You must be signed in to change notification settings - Fork 0
/
favicons.js
50 lines (49 loc) · 1.28 KB
/
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
var fs = require("fs");
var favicons = require("favicons"),
source = "src/images/logo.svg",
output = "static/",
configuration = {
path: "/",
appName: "arbre.app",
appShortName: "arbre.app",
appDescription: "",
developerName: "Florian Cassayre",
developerURL: "https://florian.cassayre.me",
dir: "auto",
lang: "fr-FR",
background: "#fff",
theme_color: "#fff",
appleStatusBarStyle: "black-translucent",
display: "standalone",
orientation: "any",
scope: "/",
start_url: "/?homescreen=1",
preferRelatedApplications: false,
relatedApplications: undefined,
version: "1.0",
logging: false,
pixel_art: false,
loadManifestWithCredentials: false,
manifestMaskable: false,
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: true,
favicons: true,
firefox: true,
windows: true,
yandex: true,
},
},
callback = function (error, response) {
if (error) {
console.log(error.message);
return;
}
[response.images, response.files].forEach(files => files.forEach(({ name, contents }) => {
fs.writeFileSync(output + name, contents);
}));
console.log(response.html.join("\n"));
};
favicons(source, configuration, callback);