project-targets.js 1.3 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. /**
  3. * @license
  4. * Copyright Google LLC All Rights Reserved.
  5. *
  6. * Use of this source code is governed by an MIT-style license that can be
  7. * found in the LICENSE file at https://angular.io/license
  8. */
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. const schematics_1 = require("@angular-devkit/schematics");
  11. /** Resolves the architect options for the build target of the given project. */
  12. function getProjectTargetOptions(project, buildTarget) {
  13. if (project.targets &&
  14. project.targets[buildTarget] &&
  15. project.targets[buildTarget].options) {
  16. return project.targets[buildTarget].options;
  17. }
  18. // TODO(devversion): consider removing this architect check if the CLI completely switched
  19. // over to `targets`, and the `architect` support has been removed.
  20. // See: https://github.com/angular/angular-cli/commit/307160806cb48c95ecb8982854f452303801ac9f
  21. if (project.architect &&
  22. project.architect[buildTarget] &&
  23. project.architect[buildTarget].options) {
  24. return project.architect[buildTarget].options;
  25. }
  26. throw new schematics_1.SchematicsException(`Cannot determine project target configuration for: ${buildTarget}.`);
  27. }
  28. exports.getProjectTargetOptions = getProjectTargetOptions;
  29. //# sourceMappingURL=project-targets.js.map