@rushstack/heft
Version:
Build all your JavaScript projects the same way: A way that works.
21 lines • 937 B
JavaScript
;
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.PLUGIN_NAME = void 0;
exports.PLUGIN_NAME = 'set-environment-variables-plugin';
class SetEnvironmentVariablesPlugin {
apply(taskSession, heftConfiguration, { environmentVariablesToSet }) {
taskSession.hooks.run.tap({
name: exports.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;
}
});
}
}
exports.default = SetEnvironmentVariablesPlugin;
//# sourceMappingURL=SetEnvironmentVariablesPlugin.js.map