1
- ' use strict' ;
1
+ " use strict" ;
2
2
3
- const path = require ( ' path' ) ;
4
- const fs = require ( 'fs' ) ;
5
- const url = require ( ' url' ) ;
3
+ const path = require ( " path" ) ;
4
+ const fs = require ( "fs" ) ;
5
+ const url = require ( " url" ) ;
6
6
7
7
// Make sure any symlinks in the project folder are resolved:
8
8
// https://github.com/facebookincubator/create-react-app/issues/637
@@ -12,7 +12,7 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
12
12
const envPublicUrl = process . env . PUBLIC_URL ;
13
13
14
14
function ensureSlash ( path , needsSlash ) {
15
- const hasSlash = path . endsWith ( '/' ) ;
15
+ const hasSlash = path . endsWith ( "/" ) ;
16
16
if ( hasSlash && ! needsSlash ) {
17
17
return path . substr ( path , path . length - 1 ) ;
18
18
} else if ( ! hasSlash && needsSlash ) {
@@ -34,22 +34,22 @@ const getPublicUrl = appPackageJson =>
34
34
function getServedPath ( appPackageJson ) {
35
35
const publicUrl = getPublicUrl ( appPackageJson ) ;
36
36
const servedUrl =
37
- envPublicUrl || ( publicUrl ? url . parse ( publicUrl ) . pathname : '/' ) ;
37
+ envPublicUrl || ( publicUrl ? url . parse ( publicUrl ) . pathname : "/" ) ;
38
38
return ensureSlash ( servedUrl , true ) ;
39
39
}
40
40
41
41
// config after eject: we're in ./config/
42
42
module . exports = {
43
- dotenv : resolveApp ( ' .env' ) ,
44
- appBuild : resolveApp ( ' build' ) ,
45
- appPublic : resolveApp ( ' public' ) ,
46
- appHtml : resolveApp ( ' public/index.html' ) ,
47
- appIndexJs : resolveApp ( ' src/index.js' ) ,
48
- appPackageJson : resolveApp ( ' package.json' ) ,
49
- appSrc : resolveApp ( ' src' ) ,
50
- yarnLockFile : resolveApp ( ' yarn.lock' ) ,
51
- testsSetup : resolveApp ( ' src/setupTests.js' ) ,
52
- appNodeModules : resolveApp ( ' node_modules' ) ,
53
- publicUrl : getPublicUrl ( resolveApp ( ' package.json' ) ) ,
54
- servedPath : getServedPath ( resolveApp ( ' package.json' ) ) ,
43
+ dotenv : resolveApp ( " .env" ) ,
44
+ appBuild : resolveApp ( " build" ) ,
45
+ appPublic : resolveApp ( " public" ) ,
46
+ appHtml : resolveApp ( " public/index.html" ) ,
47
+ appIndexJs : resolveApp ( " src/index.js" ) ,
48
+ appPackageJson : resolveApp ( " package.json" ) ,
49
+ appSrc : resolveApp ( " src" ) ,
50
+ yarnLockFile : resolveApp ( " yarn.lock" ) ,
51
+ testsSetup : resolveApp ( " src/setupTests.js" ) ,
52
+ appNodeModules : resolveApp ( " node_modules" ) ,
53
+ publicUrl : getPublicUrl ( resolveApp ( " package.json" ) ) ,
54
+ servedPath : getServedPath ( resolveApp ( " package.json" ) )
55
55
} ;
0 commit comments