@@ -51,6 +51,7 @@ func (App) CreateBundle() {
51
51
var appName string
52
52
var deployment string
53
53
var rnDir string
54
+ var isTypescriptProject bool
54
55
var description string
55
56
var isMinifyDisabled bool
56
57
var hermes bool
@@ -61,12 +62,13 @@ func (App) CreateBundle() {
61
62
flag .StringVar (& rnDir , "p" , "./" , "React native project dir" )
62
63
flag .StringVar (& description , "description" , "" , "Description" )
63
64
flag .BoolVar (& isMinifyDisabled , "disable-minify" , false , "Disable minify" )
65
+ flag .BoolVar (& isTypescriptProject , "bundle-typescript" , false , "Bundle typescript project" )
64
66
flag .BoolVar (& hermes , "hermes" , false , "Enable hermes" )
65
67
66
68
flag .Parse ()
67
69
68
70
if targetVersion == "" || appName == "" || deployment == "" {
69
- fmt .Println ("Usage: code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <deployment> -p <*Optional React native project dir> --description <*Optional Description> --disable-minify (*Optional) --hermes (*Optional)" )
71
+ fmt .Println ("Usage: code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <deployment> -p <*Optional React native project dir> --description <*Optional Description> --disable-minify (*Optional) --bundle-typescript (*Optional) -- hermes (*Optional)" )
70
72
return
71
73
}
72
74
log .Println ("Get app info..." )
@@ -109,6 +111,12 @@ func (App) CreateBundle() {
109
111
if isMinifyDisabled {
110
112
minify = "false"
111
113
}
114
+
115
+ indexFile := "index.js"
116
+ if isTypescriptProject {
117
+ indexFile = "index.tsx"
118
+ }
119
+
112
120
buildUrl := rnDir + "build/CodePush"
113
121
bundelUrl := buildUrl + "/" + jsName
114
122
cmd := exec .Command (
@@ -122,7 +130,7 @@ func (App) CreateBundle() {
122
130
"--dev" ,
123
131
"false" ,
124
132
"--entry-file" ,
125
- "index.js" ,
133
+ indexFile ,
126
134
"--platform" ,
127
135
osName ,
128
136
"--minify" ,
0 commit comments