@harves/nx-node-esm-plugin
Version:
Node executor including ESM module resolution for buildable libraries within Nx workspaces.
29 lines • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadEnvVars = void 0;
const tslib_1 = require("tslib");
/**
*
* @param path
*
* @see https://github.com/nrwl/nx/blob/d010267d83119638d325c5f92b76b4dac2dceb53/packages/nx/src/executors/run-commands/run-commands.impl.ts#L18C1-L29C2
*/
function loadEnvVars(path) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (path) {
const result = (yield Promise.resolve().then(() => require('dotenv'))).config({ path });
if (result.error) {
throw result.error;
}
}
else {
try {
(yield Promise.resolve().then(() => require('dotenv'))).config();
// eslint-disable-next-line no-empty
}
catch (_a) { }
}
});
}
exports.loadEnvVars = loadEnvVars;
//# sourceMappingURL=load-env-vars.js.map