mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-17 12:16:31 +08:00
committed by
Dan Abramov
parent
2f62ff84db
commit
afe25dfe5c
@@ -14,6 +14,7 @@
|
||||
|
||||
var REACT_APP = /^REACT_APP_/i;
|
||||
var NODE_ENV = JSON.stringify(process.env.NODE_ENV || 'development');
|
||||
var NODE_PATH = process.env.NODE_PATH || '';
|
||||
|
||||
module.exports = Object
|
||||
.keys(process.env)
|
||||
@@ -22,5 +23,6 @@ module.exports = Object
|
||||
env['process.env.' + key] = JSON.stringify(process.env[key]);
|
||||
return env;
|
||||
}, {
|
||||
'process.env.NODE_ENV': NODE_ENV
|
||||
'process.env.NODE_ENV': NODE_ENV,
|
||||
'process.env.NODE_PATH': NODE_PATH
|
||||
});
|
||||
|
||||
@@ -67,6 +67,9 @@ module.exports = {
|
||||
publicPath: '/'
|
||||
},
|
||||
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.
|
||||
extensions: ['.js', '.json', ''],
|
||||
alias: {
|
||||
|
||||
@@ -62,6 +62,9 @@ module.exports = {
|
||||
publicPath: publicPath
|
||||
},
|
||||
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.
|
||||
extensions: ['.js', '.json', ''],
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user