@@ -48,13 +48,18 @@ function getServedPath(appPackageJson) {
4848 return ensureSlash ( servedUrl , true ) ;
4949}
5050
51+ // Detect appIndexFile base on REACT_APP env
52+ const appIndexFile = process . env . REACT_APP
53+ ? process . env . REACT_APP + 'Index'
54+ : 'index' ;
55+
5156// config after eject: we're in ./config/
5257module . exports = {
5358 dotenv : resolveApp ( '.env' ) ,
5459 appBuild : resolveApp ( 'build' ) ,
5560 appPublic : resolveApp ( 'public' ) ,
5661 appHtml : resolveApp ( 'public/index.html' ) ,
57- appIndexJs : resolveApp ( 'src/index .js' ) ,
62+ appIndexJs : resolveApp ( 'src/' + appIndexFile + ' .js') ,
5863 appPackageJson : resolveApp ( 'package.json' ) ,
5964 appSrc : resolveApp ( 'src' ) ,
6065 yarnLockFile : resolveApp ( 'yarn.lock' ) ,
@@ -74,7 +79,7 @@ module.exports = {
7479 appBuild : resolveApp ( 'build' ) ,
7580 appPublic : resolveApp ( 'public' ) ,
7681 appHtml : resolveApp ( 'public/index.html' ) ,
77- appIndexJs : resolveApp ( 'src/index .js' ) ,
82+ appIndexJs : resolveApp ( 'src/' + appIndexFile + ' .js') ,
7883 appPackageJson : resolveApp ( 'package.json' ) ,
7984 appSrc : resolveApp ( 'src' ) ,
8085 yarnLockFile : resolveApp ( 'yarn.lock' ) ,
104109 appBuild : resolveOwn ( '../../build' ) ,
105110 appPublic : resolveOwn ( 'template/public' ) ,
106111 appHtml : resolveOwn ( 'template/public/index.html' ) ,
107- appIndexJs : resolveOwn ( 'template/src/index .js' ) ,
112+ appIndexJs : resolveOwn ( 'template/src/' + appIndexFile + ' .js') ,
108113 appPackageJson : resolveOwn ( 'package.json' ) ,
109114 appSrc : resolveOwn ( 'template/src' ) ,
110115 yarnLockFile : resolveOwn ( 'template/yarn.lock' ) ,
0 commit comments