1 | "use strict";
|
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4 | return new (P || (P = Promise))(function (resolve, reject) {
|
5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9 | });
|
10 | };
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | exports.executeBrowserBasedBuilder = void 0;
|
13 | const architect_1 = require("@angular-devkit/architect");
|
14 | const rxjs_1 = require("rxjs");
|
15 | const operators_1 = require("rxjs/operators");
|
16 | const transform_factories_1 = require("./transform-factories");
|
17 | const executeBrowserBasedBuilder = (executebBuilder) => (options, context) => {
|
18 | function setup() {
|
19 | return __awaiter(this, void 0, void 0, function* () {
|
20 | var _a;
|
21 | const browserTarget = (0, architect_1.targetFromTargetString)(
|
22 |
|
23 | (_a = options.buildTarget) !== null && _a !== void 0 ? _a : options.browserTarget);
|
24 | return context.getTargetOptions(browserTarget);
|
25 | });
|
26 | }
|
27 | return (0, rxjs_1.from)(setup()).pipe((0, operators_1.switchMap)(customWebpackOptions => executebBuilder(options, context, (0, transform_factories_1.getTransforms)(customWebpackOptions, context))));
|
28 | };
|
29 | exports.executeBrowserBasedBuilder = executeBrowserBasedBuilder;
|
30 |
|
\ | No newline at end of file |