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
afe25dfe
Commit
afe25dfe
authored
8 years ago
by
Jimmy Miller
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Made webpack respect NODE_PATH environment variable
Fixes:
#253
parent
2f62ff84
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/env.js
+3
-1
config/env.js
config/webpack.config.dev.js
+3
-0
config/webpack.config.dev.js
config/webpack.config.prod.js
+3
-0
config/webpack.config.prod.js
with
9 additions
and
1 deletion
+9
-1
config/env.js
+
3
-
1
View file @
afe25dfe
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
var
REACT_APP
=
/^REACT_APP_/i
;
var
REACT_APP
=
/^REACT_APP_/i
;
var
NODE_ENV
=
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'
development
'
);
var
NODE_ENV
=
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'
development
'
);
var
NODE_PATH
=
process
.
env
.
NODE_PATH
||
''
;
module
.
exports
=
Object
module
.
exports
=
Object
.
keys
(
process
.
env
)
.
keys
(
process
.
env
)
...
@@ -22,5 +23,6 @@ module.exports = Object
...
@@ -22,5 +23,6 @@ module.exports = Object
env
[
'
process.env.
'
+
key
]
=
JSON
.
stringify
(
process
.
env
[
key
]);
env
[
'
process.env.
'
+
key
]
=
JSON
.
stringify
(
process
.
env
[
key
]);
return
env
;
return
env
;
},
{
},
{
'
process.env.NODE_ENV
'
:
NODE_ENV
'
process.env.NODE_ENV
'
:
NODE_ENV
,
'
process.env.NODE_PATH
'
:
NODE_PATH
});
});
This diff is collapsed.
Click to expand it.
config/webpack.config.dev.js
+
3
-
0
View file @
afe25dfe
...
@@ -67,6 +67,9 @@ module.exports = {
...
@@ -67,6 +67,9 @@ module.exports = {
publicPath
:
'
/
'
publicPath
:
'
/
'
},
},
resolve
:
{
resolve
:
{
// This allows you to set a root for where webpack should look for modules.
// This enables you to use absolute imports from the root.
root
:
path
.
resolve
(
env
[
'
process.env.NODE_PATH
'
]),
// These are the reasonable defaults supported by the Node ecosystem.
// These are the reasonable defaults supported by the Node ecosystem.
extensions
:
[
'
.js
'
,
'
.json
'
,
''
],
extensions
:
[
'
.js
'
,
'
.json
'
,
''
],
alias
:
{
alias
:
{
...
...
This diff is collapsed.
Click to expand it.
config/webpack.config.prod.js
+
3
-
0
View file @
afe25dfe
...
@@ -62,6 +62,9 @@ module.exports = {
...
@@ -62,6 +62,9 @@ module.exports = {
publicPath
:
publicPath
publicPath
:
publicPath
},
},
resolve
:
{
resolve
:
{
// This allows you to set a root for where webpack should look for modules.
// This enables you to use absolute imports from the root.
root
:
path
.
resolve
(
env
[
'
process.env.NODE_PATH
'
]),
// These are the reasonable defaults supported by the Node ecosystem.
// These are the reasonable defaults supported by the Node ecosystem.
extensions
:
[
'
.js
'
,
'
.json
'
,
''
],
extensions
:
[
'
.js
'
,
'
.json
'
,
''
],
alias
:
{
alias
:
{
...
...
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