forked from zoontek/react-native-bootsplash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-native.config.js
85 lines (83 loc) · 2.33 KB
/
react-native.config.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
/** @type {import("@react-native-community/cli-types").Command} */
const generateBootSplash = {
name: "generate-bootsplash <logo>",
description: "Generate a launch screen using a logo file path (PNG or SVG)",
options: [
{
name: "--platforms <list>",
description: "Platforms to generate for, separated by a comma",
default: "android,ios,web",
parse: (value) =>
value
.toLowerCase()
.split(/[ ,;|]/)
.map((platform) => platform.trim())
.filter((platform) => platform !== ""),
},
{
name: "--background <string>",
description: "Background color (in hexadecimal format)",
default: "#fff",
},
{
name: "--logo-width <number>",
description:
"Logo width at @1x (in dp - we recommend approximately ~100)",
default: 100,
parse: (value) => parseInt(value, 10),
},
{
name: "--assets-output <string>",
description: "Assets output directory path",
},
{
name: "--flavor <string>",
description:
"Android flavor build variant (where your resource directory is)",
default: "main",
},
{
name: "--html <string>",
description: "HTML template file path (your web app entry point)",
default: "index.html",
},
{
name: "--license-key <string>",
description:
"License key to enable brand and dark mode assets generation",
},
{
name: "--brand <string>",
description: "Brand file path (PNG or SVG)",
},
{
name: "--brand-width <number>",
description:
"Brand width at @1x (in dp - we recommend approximately ~80)",
default: 80,
parse: (value) => parseInt(value, 10),
},
{
name: "--dark-background <string>",
description: "[dark mode] Background color (in hexadecimal format)",
},
{
name: "--dark-logo <string>",
description: "[dark mode] Logo file path (PNG or SVG)",
},
{
name: "--dark-brand <string>",
description: "[dark mode] Brand file path (PNG or SVG)",
},
],
func: (argv, ctx, args) => {
const { generate } = require("./dist/commonjs/generate");
generate(argv, ctx, args).catch((error) => {
console.error(error);
process.exit(1);
});
},
};
module.exports = {
commands: [generateBootSplash],
};