Skip to content

Commit 991714f

Browse files
committed
Clarify that own* properties only exist before ejecting
1 parent e91218f commit 991714f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/react-scripts/config/paths.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ module.exports = {
8383
yarnLockFile: resolveApp('yarn.lock'),
8484
testsSetup: resolveApp('src/setupTests.js'),
8585
appNodeModules: resolveApp('node_modules'),
86-
ownNodeModules: resolveApp('node_modules'),
8786
nodePaths: nodePaths,
8887
publicUrl: getPublicUrl(resolveApp('package.json')),
8988
servedPath: getServedPath(resolveApp('package.json'))
@@ -97,7 +96,6 @@ function resolveOwn(relativePath) {
9796
// config before eject: we're in ./node_modules/react-scripts/config/
9897
module.exports = {
9998
appPath: resolveApp('.'),
100-
ownPath: resolveOwn('.'),
10199
appBuild: resolveApp('build'),
102100
appPublic: resolveApp('public'),
103101
appHtml: resolveApp('public/index.html'),
@@ -107,11 +105,12 @@ module.exports = {
107105
yarnLockFile: resolveApp('yarn.lock'),
108106
testsSetup: resolveApp('src/setupTests.js'),
109107
appNodeModules: resolveApp('node_modules'),
110-
// this is empty with npm3 but node resolution searches higher anyway:
111-
ownNodeModules: resolveOwn('node_modules'),
112108
nodePaths: nodePaths,
113109
publicUrl: getPublicUrl(resolveApp('package.json')),
114-
servedPath: getServedPath(resolveApp('package.json'))
110+
servedPath: getServedPath(resolveApp('package.json')),
111+
// These properties only exist before ejecting:
112+
ownPath: resolveOwn('.'),
113+
ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
115114
};
116115

117116
var reactScriptsPath = path.resolve('node_modules/react-scripts');
@@ -121,7 +120,6 @@ var reactScriptsLinked = fs.existsSync(reactScriptsPath) && fs.lstatSync(reactSc
121120
if (!reactScriptsLinked && __dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1) {
122121
module.exports = {
123122
appPath: resolveApp('.'),
124-
ownPath: resolveOwn('.'),
125123
appBuild: resolveOwn('../../build'),
126124
appPublic: resolveOwn('template/public'),
127125
appHtml: resolveOwn('template/public/index.html'),
@@ -131,10 +129,12 @@ if (!reactScriptsLinked && __dirname.indexOf(path.join('packages', 'react-script
131129
yarnLockFile: resolveOwn('template/yarn.lock'),
132130
testsSetup: resolveOwn('template/src/setupTests.js'),
133131
appNodeModules: resolveOwn('node_modules'),
134-
ownNodeModules: resolveOwn('node_modules'),
135132
nodePaths: nodePaths,
136133
publicUrl: getPublicUrl(resolveOwn('package.json')),
137-
servedPath: getServedPath(resolveOwn('package.json'))
134+
servedPath: getServedPath(resolveOwn('package.json')),
135+
// These properties only exist before ejecting:
136+
ownPath: resolveOwn('.'),
137+
ownNodeModules: resolveOwn('node_modules'),
138138
};
139139
}
140140
// @remove-on-eject-end

0 commit comments

Comments
 (0)