UNPKG

piral-cli-webpack5

Version:

Provides debug and build capabilities for pilets and Piral instances using Webpack v5.

27 lines 939 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVariables = getVariables; exports.setEnvironment = setEnvironment; exports.getDefineVariables = getDefineVariables; function getVariables(name, version, externals, env) { return { NODE_ENV: env, BUILD_TIME: new Date().toDateString(), BUILD_TIME_FULL: new Date().toISOString(), BUILD_PCKG_VERSION: version, BUILD_PCKG_NAME: name, SHARED_DEPENDENCIES: externals.join(','), DEBUG_PIRAL: '', DEBUG_PILET: '', }; } function setEnvironment(variables) { Object.keys(variables).forEach((key) => (process.env[key] = String(variables[key]))); } function getDefineVariables(variables) { return Object.entries(variables).reduce((obj, [name, value]) => { obj[`process.env.${name}`] = JSON.stringify(value); return obj; }, {}); } //# sourceMappingURL=helpers.js.map