UNPKG

infrastructure-components

Version:

Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.

39 lines (35 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* export class Environment extends React.Component<IEnvironment, {}> { constructor(props) { super(props); } render () { return null; } } export default Environment; */ exports.default = (props) => { // execute during runtime, here we can use objects! /*if (props.infrastructureMode === "component") { return { } };*/ if (process.env.ENVIRONMENT !== props.name) { console.log(`environment ${props.name} does not apply to specified ${process.env.ENVIRONMENT}`); return {}; } // this part is loaded on compilation and MUST NOT contain any dependencies return Object.assign({}, props, { infrastructureType: "environment", }, props.offlinePort !== undefined ? { slsConfig: { provider: { PORT: props.offlinePort } } } : {}); }; //# sourceMappingURL=environment.js.map