project-main-file.js 931 B

12345678910111213141516171819202122
  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. const project_targets_1 = require("./project-targets");
  12. /** Looks for the main TypeScript file in the given project and returns its path. */
  13. function getProjectMainFile(project) {
  14. const buildOptions = project_targets_1.getProjectTargetOptions(project, 'build');
  15. if (!buildOptions.main) {
  16. throw new schematics_1.SchematicsException(`Could not find the project main file inside of the ` +
  17. `workspace config (${project.sourceRoot})`);
  18. }
  19. return buildOptions.main;
  20. }
  21. exports.getProjectMainFile = getProjectMainFile;
  22. //# sourceMappingURL=project-main-file.js.map