UNPKG

2.2 kBJavaScriptView Raw
1"use strict";
2var __importStar = (this && this.__importStar) || function (mod) {
3 if (mod && mod.__esModule) return mod;
4 var result = {};
5 if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6 result["default"] = mod;
7 return result;
8};
9Object.defineProperty(exports, "__esModule", { value: true });
10const plugin_1 = require("../libs/plugin");
11const identity_component_1 = require("../identity/identity-component");
12const deepmerge = __importStar(require("deepmerge"));
13/**
14 * We require an IdentityPlugin to forward the configuration from lower level webapps
15 * TODO: refactor so that we don't need such dummy plugins!
16 */
17exports.IdentityPlugin = (props) => {
18 const path = require('path');
19 const result = {
20 applies: (component) => {
21 return identity_component_1.isIdentity(component);
22 },
23 // convert the component into configuration parts
24 // while the component is of Type `any`, its props must be of type `IDataLayerArgs` | `IDataLayerProps`
25 process: (component, childConfigs, infrastructureMode) => {
26 return {
27 slsConfigs: deepmerge.all(childConfigs.map(config => config.slsConfigs)),
28 // add the server config
29 webpackConfigs: childConfigs.reduce((result, config) => result.concat(config.webpackConfigs), []),
30 postBuilds: childConfigs.reduce((result, config) => result.concat(config.postBuilds), []),
31 iamRoleStatements: plugin_1.forwardChildIamRoleStatements(childConfigs)
32 /* THESE VALUES MUST NOT BE PROVIDED BY A CHILD, THEY ARE NOT FORWARED UPWARDS
33
34 environments: environments,
35
36 //stackName: component.stackName,
37
38 assetsPath: component.assetsPath,
39
40 buildPath: component.buildPath,
41
42 region: component.region,
43
44 domain: domain,
45
46 certArn: certArn,
47
48 supportOfflineStart: true,
49
50 supportCreateDomain: true
51 */
52 };
53 }
54 };
55 return result;
56};
57//# sourceMappingURL=template-plugin.js.map
\No newline at end of file