-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
57 lines (57 loc) · 1.45 KB
/
build.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
const watch = process.argv[2] === "-w";
require("esbuild")
.build({
entryPoints: ["src/index.tsx"],
outfile: "dist/index.js",
bundle: true,
format: "esm",
// minify: true,
sourcemap: true,
external: [
"@react-native-community/async-storage",
"@react-native-community/blur",
"@react-native-community/datetimepicker",
"@react-native-community/picker",
"@sentry/browser",
"@sentry/react",
"@sentry/react-native",
"mixpanel-browser",
"react",
"react-app-polyfill",
"react-date-picker",
"react-dev-utils",
"react-dom",
"react-native",
"react-native-gesture-handler",
"react-native-haptic-feedback",
"react-native-hyperlink",
"react-native-modalize",
"react-native-navigation",
"react-native-permissions",
"react-native-picker-select",
"react-native-portalize",
"react-native-svg",
"react-router",
"react-router-dom",
// "victory-native",
],
inject: ["./react-shim.js"],
watch: watch
? {
onRebuild(error, result) {
if (error) {
console.error("watch build failed:", error);
} else {
console.log("watch build succeeded:", result);
}
},
}
: false,
})
.then((result) => {
if (watch) {
console.log("Watching...");
} else {
console.log("Build complete!");
}
});