UNPKG

1.81 kBJavaScriptView Raw
1"use strict";
2var __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};
11Object.defineProperty(exports, "__esModule", { value: true });
12exports.executeBrowserBasedBuilder = void 0;
13const architect_1 = require("@angular-devkit/architect");
14const rxjs_1 = require("rxjs");
15const operators_1 = require("rxjs/operators");
16const transform_factories_1 = require("./transform-factories");
17const 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 // `browserTarget` has been deprecated.
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};
29exports.executeBrowserBasedBuilder = executeBrowserBasedBuilder;
30//# sourceMappingURL=generic-browser-builder.js.map
\No newline at end of file