infrastructure-components
Version:
Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.
57 lines (48 loc) • 2.12 kB
JavaScript
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugin_1 = require("../libs/plugin");
const identity_component_1 = require("./identity-component");
const deepmerge = __importStar(require("deepmerge"));
/**
* We require an IdentityPlugin to forward the configuration from lower level webapps
* TODO: refactor so that we don't need such dummy plugins!
*/
exports.IdentityPlugin = (props) => {
const path = require('path');
const result = {
applies: (component) => {
return identity_component_1.isIdentity(component);
},
// convert the component into configuration parts
// while the component is of Type `any`, its props must be of type `IDataLayerArgs` | `IDataLayerProps`
process: (component, childConfigs, infrastructureMode) => {
return {
slsConfigs: deepmerge.all(childConfigs.map(config => config.slsConfigs)),
// add the server config
webpackConfigs: plugin_1.forwardChildWebpackConfigs(childConfigs),
postBuilds: plugin_1.forwardChildPostBuilds(childConfigs),
iamRoleStatements: plugin_1.forwardChildIamRoleStatements(childConfigs)
/* THESE VALUES MUST NOT BE PROVIDED BY A CHILD, THEY ARE NOT FORWARED UPWARDS
environments: environments,
//stackName: component.stackName,
assetsPath: component.assetsPath,
buildPath: component.buildPath,
region: component.region,
domain: domain,
certArn: certArn,
supportOfflineStart: true,
supportCreateDomain: true
*/
};
}
};
return result;
};
//# sourceMappingURL=identity-plugin.js.map
;