Define npm_config_jobs env variable in build scripts (#21315)

Adds the npm_config_jobs env variable across build scripts that may benefit from it (ones that run apm install). This variable is used by node-gyp to compile native code with a number of threads equal to the reported CPU core count
This commit is contained in:
Benjamin Gray
2021-01-23 06:03:30 +10:00
committed by GitHub
parent 0008c25757
commit 4e1f76530c

View File

@@ -29,6 +29,12 @@ const appName = getAppName(channel);
const executableName = getExecutableName(channel, appName);
const channelName = getChannelName(channel);
// Sets the installation jobs to run maximally in parallel if the user has
// not already configured this. This is applied just by requiring this file.
if (process.env.npm_config_jobs === undefined) {
process.env.npm_config_jobs = 'max';
}
module.exports = {
appMetadata,
apmMetadata,