@@ -48,13 +48,18 @@ function getServedPath(appPackageJson) {
48
48
return ensureSlash ( servedUrl , true ) ;
49
49
}
50
50
51
+ // Detect appIndexFile base on REACT_APP env
52
+ const appIndexFile = process . env . REACT_APP
53
+ ? process . env . REACT_APP + 'Index'
54
+ : 'index' ;
55
+
51
56
// config after eject: we're in ./config/
52
57
module . exports = {
53
58
dotenv : resolveApp ( '.env' ) ,
54
59
appBuild : resolveApp ( 'build' ) ,
55
60
appPublic : resolveApp ( 'public' ) ,
56
61
appHtml : resolveApp ( 'public/index.html' ) ,
57
- appIndexJs : resolveApp ( 'src/index .js' ) ,
62
+ appIndexJs : resolveApp ( 'src/' + appIndexFile + ' .js') ,
58
63
appPackageJson : resolveApp ( 'package.json' ) ,
59
64
appSrc : resolveApp ( 'src' ) ,
60
65
yarnLockFile : resolveApp ( 'yarn.lock' ) ,
@@ -74,7 +79,7 @@ module.exports = {
74
79
appBuild : resolveApp ( 'build' ) ,
75
80
appPublic : resolveApp ( 'public' ) ,
76
81
appHtml : resolveApp ( 'public/index.html' ) ,
77
- appIndexJs : resolveApp ( 'src/index .js' ) ,
82
+ appIndexJs : resolveApp ( 'src/' + appIndexFile + ' .js') ,
78
83
appPackageJson : resolveApp ( 'package.json' ) ,
79
84
appSrc : resolveApp ( 'src' ) ,
80
85
yarnLockFile : resolveApp ( 'yarn.lock' ) ,
104
109
appBuild : resolveOwn ( '../../build' ) ,
105
110
appPublic : resolveOwn ( 'template/public' ) ,
106
111
appHtml : resolveOwn ( 'template/public/index.html' ) ,
107
- appIndexJs : resolveOwn ( 'template/src/index .js' ) ,
112
+ appIndexJs : resolveOwn ( 'template/src/' + appIndexFile + ' .js') ,
108
113
appPackageJson : resolveOwn ( 'package.json' ) ,
109
114
appSrc : resolveOwn ( 'template/src' ) ,
110
115
yarnLockFile : resolveOwn ( 'template/yarn.lock' ) ,
0 commit comments