rev comment re: NODE_PATH

This commit is contained in:
Michael Bradley, Jr 2018-08-18 19:36:50 -05:00
parent 792a8f57eb
commit 2c54349c33
1 changed files with 6 additions and 3 deletions

View File

@ -20,9 +20,12 @@ if (!process.env.EMBARK_PATH) {
process.env.EMBARK_PATH = utils.joinPath(__dirname, '..'); process.env.EMBARK_PATH = utils.joinPath(__dirname, '..');
} }
// enable lookup of *global* embark's own node_modules from within dapp scripts // NOTE: setting NODE_PATH at runtime won't effect lookup behavior in the
// this makes embark's dependencies trasitive dependencies of a dapp without the // current process, but will take effect in child processes; this enables
// dapp explicitly specifying embark as a dependency in the dapp's package.json // lookup of *global* embark's own node_modules from within dapp scripts (such
// as an ejected webpack.config.js), making embark's dependencies trasitive
// dependencies of a dapp without the dapp explicitly specifying embark as a
// dependency in the dapp's package.json
process.env.NODE_PATH = utils.joinPath(process.env.EMBARK_PATH, 'node_modules') process.env.NODE_PATH = utils.joinPath(process.env.EMBARK_PATH, 'node_modules')
+ (process.env.NODE_PATH ? (process.platform === 'win32' ? ';' : ':') : '') + (process.env.NODE_PATH ? (process.platform === 'win32' ? ';' : ':') : '')
+ (process.env.NODE_PATH || ''); + (process.env.NODE_PATH || '');