@@ -17,28 +17,7 @@ const url = require('url');
17
17
// Make sure any symlinks in the project folder are resolved:
18
18
// https://github.com/facebookincubator/create-react-app/issues/637
19
19
const appDirectory = fs . realpathSync ( process . cwd ( ) ) ;
20
- const resolveApp = ( relativePath ) => path . resolve ( appDirectory , relativePath ) ;
21
-
22
- // We support resolving modules according to `NODE_PATH`.
23
- // This lets you use absolute paths in imports inside large monorepos:
24
- // https://github.com/facebookincubator/create-react-app/issues/253.
25
-
26
- // It works similar to `NODE_PATH` in Node itself:
27
- // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
28
-
29
- // We will export `nodePaths` as an array of absolute paths.
30
- // It will then be used by Webpack configs.
31
- // Jest doesn’t need this because it already handles `NODE_PATH` out of the box.
32
-
33
- // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
34
- // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
35
- // https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
36
-
37
- const nodePaths = ( process . env . NODE_PATH || '' )
38
- . split ( process . platform === 'win32' ? ';' : ':' )
39
- . filter ( Boolean )
40
- . filter ( folder => ! path . isAbsolute ( folder ) )
41
- . map ( resolveApp ) ;
20
+ const resolveApp = relativePath => path . resolve ( appDirectory , relativePath ) ;
42
21
43
22
const envPublicUrl = process . env . PUBLIC_URL ;
44
23
@@ -53,7 +32,8 @@ function ensureSlash(path, needsSlash) {
53
32
}
54
33
}
55
34
56
- const getPublicUrl = ( appPackageJson ) => envPublicUrl || require ( appPackageJson ) . homepage ;
35
+ const getPublicUrl = appPackageJson =>
36
+ envPublicUrl || require ( appPackageJson ) . homepage ;
57
37
58
38
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
59
39
// "public path" at which the app is served.
@@ -80,13 +60,12 @@ module.exports = {
80
60
yarnLockFile : resolveApp ( 'yarn.lock' ) ,
81
61
testsSetup : resolveApp ( 'src/setupTests.js' ) ,
82
62
appNodeModules : resolveApp ( 'node_modules' ) ,
83
- nodePaths : nodePaths ,
84
63
publicUrl : getPublicUrl ( resolveApp ( 'package.json' ) ) ,
85
64
servedPath : getServedPath ( resolveApp ( 'package.json' ) ) ,
86
65
} ;
87
66
88
67
// @remove -on-eject-begin
89
- const resolveOwn = ( relativePath ) => path . resolve ( __dirname , '..' , relativePath ) ;
68
+ const resolveOwn = relativePath => path . resolve ( __dirname , '..' , relativePath ) ;
90
69
91
70
// config before eject: we're in ./node_modules/react-scripts/config/
92
71
module . exports = {
@@ -101,7 +80,6 @@ module.exports = {
101
80
yarnLockFile : resolveApp ( 'yarn.lock' ) ,
102
81
testsSetup : resolveApp ( 'src/setupTests.js' ) ,
103
82
appNodeModules : resolveApp ( 'node_modules' ) ,
104
- nodePaths : nodePaths ,
105
83
publicUrl : getPublicUrl ( resolveApp ( 'package.json' ) ) ,
106
84
servedPath : getServedPath ( resolveApp ( 'package.json' ) ) ,
107
85
// These properties only exist before ejecting:
131
109
yarnLockFile : resolveOwn ( 'template/yarn.lock' ) ,
132
110
testsSetup : resolveOwn ( 'template/src/setupTests.js' ) ,
133
111
appNodeModules : resolveOwn ( 'node_modules' ) ,
134
- nodePaths : nodePaths ,
135
112
publicUrl : getPublicUrl ( resolveOwn ( 'package.json' ) ) ,
136
113
servedPath : getServedPath ( resolveOwn ( 'package.json' ) ) ,
137
114
// These properties only exist before ejecting:
0 commit comments