UNPKG

@rushstack/heft

Version:

Build all your JavaScript projects the same way: A way that works.

17 lines 793 B
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. export const PLUGIN_NAME = 'set-environment-variables-plugin'; export default class SetEnvironmentVariablesPlugin { apply(taskSession, heftConfiguration, { environmentVariablesToSet }) { taskSession.hooks.run.tap({ name: PLUGIN_NAME, stage: Number.MIN_SAFE_INTEGER }, () => { for (const [key, value] of Object.entries(environmentVariablesToSet)) { taskSession.logger.terminal.writeLine(`Setting environment variable ${key}=${value}`); process.env[key] = value; } }); } } //# sourceMappingURL=SetEnvironmentVariablesPlugin.js.map