-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhook-spawn.js
More file actions
21 lines (17 loc) · 687 Bytes
/
hook-spawn.js
File metadata and controls
21 lines (17 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
const path = require('path');
const processOnSpawn = require('process-on-spawn');
const {needsPathEnv, processNodePath} = require('./generate-require.js');
const processNodeOptions = require('./process-node-options.js');
const preloadList = require('./preload-list.js');
const preloadListEnv = require('./preload-list-env.js');
processOnSpawn.addListener(({env}) => {
env.NODE_OPTIONS = processNodeOptions(
env.NODE_OPTIONS || /* istanbul ignore next: impossible under nyc 15 */ ''
);
/* istanbul ignore next */
if (needsPathEnv(__dirname)) {
env.NODE_PATH = processNodePath(env.NODE_PATH || '');
}
env[preloadListEnv] = preloadList.join(path.delimiter);
});