Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
cf64077f
Commit
cf64077f
authored
8 years ago
by
Dan Abramov
Committed by
GitHub
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Only honor relative NODE_PATH (#1194)
parent
d68a9897
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/config/paths.js
+5
-0
packages/react-scripts/config/paths.js
with
5 additions
and
0 deletions
+5
-0
packages/react-scripts/config/paths.js
+
5
-
0
View file @
cf64077f
...
@@ -30,9 +30,14 @@ function resolveApp(relativePath) {
...
@@ -30,9 +30,14 @@ function resolveApp(relativePath) {
// It will then be used by Webpack configs.
// It will then be used by Webpack configs.
// Jest doesn’t need this because it already handles `NODE_PATH` out of the box.
// Jest doesn’t need this because it already handles `NODE_PATH` out of the box.
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
var
nodePaths
=
(
process
.
env
.
NODE_PATH
||
''
)
var
nodePaths
=
(
process
.
env
.
NODE_PATH
||
''
)
.
split
(
process
.
platform
===
'
win32
'
?
'
;
'
:
'
:
'
)
.
split
(
process
.
platform
===
'
win32
'
?
'
;
'
:
'
:
'
)
.
filter
(
Boolean
)
.
filter
(
Boolean
)
.
filter
(
folder
=>
!
path
.
isAbsolute
(
folder
))
.
map
(
resolveApp
);
.
map
(
resolveApp
);
// config after eject: we're in ./config/
// config after eject: we're in ./config/
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets