-
Notifications
You must be signed in to change notification settings - Fork 0
/
distributor.js
103 lines (98 loc) · 2.68 KB
/
distributor.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
var fs = require('fs-extra');
var data = require("./data");
[
"hiragana.min.svg",
"katakana.min.svg",
"Kyoukasho.subset.kana.ttf",
"Kyoukasho.subset.kana.woff",
"Kyoukasho.subset.kana.woff2",
].forEach(file => fs.copySync(
`./media_assets/${file}`,
`./dist/media/${file}`)
);
const faviconDescription = {
"masterPicture": "./media_assets/kana-chart.svg",
"iconsPath": "/dist",
"design": {
"ios": {
"masterPicture": "./media_assets/kana-chart-plain.svg",
"pictureAspect": "backgroundAndMargin",
"backgroundColor": data.background_color,
"margin": "0%",
"assets": {
"ios6AndPriorIcons": false,
"ios7AndLaterIcons": false,
"precomposedIcons": false,
"declareOnlyDefaultIcon": true
},
"appName": data.name,
},
"desktopBrowser": {},
"windows": {
"pictureAspect": "noChange",
"backgroundColor": data.theme_color,
"onConflict": "override",
"assets": {
"windows80Ie10Tile": false,
"windows10Ie11EdgeTiles": {
"small": false,
"medium": true,
"big": false,
"rectangle": false,
}
},
"appName": data.name,
},
"androidChrome": {
"pictureAspect": "shadow",
"themeColor": data.theme_color,
"manifest": {
"name": data.name,
"display": "standalone",
"orientation": "notSet",
"onConflict": "override",
"declared": true,
"existing_manifest": JSON.stringify({
name: data.name,
short_name: data.name,
description: data.description,
start_url: data.url,
theme_color: data.theme_color,
background_color: data.background_color,
display: "standalone",
default_locale: data.locale,
author: data.author,
offline_enabled: true,
version: data.version,
app: {
background: {},
},
manifest_version: 2,
}),
},
"assets": {
"legacyIcon": false,
"lowResolutionIcons": false,
},
},
"safariPinnedTab": {
"masterPicture": "./media_assets/kana-chart-plain.svg",
"pictureAspect": "silhouette",
"themeColor": data.theme_color,
},
},
"settings": {
"compression": 1,
"scalingAlgorithm": "Mitchell",
"errorOnImageTooSmall": false,
"readmeFile": false,
"htmlCodeFile": false,
"usePathAsIs": false,
},
"versioning": {
"paramName": "v",
"paramValue": Math.random().toString(36).substr(2, 9),
},
};
fs.writeFileSync(`dist/faviconDescription.json`, JSON.stringify(faviconDescription));
module.exports = {};