UNPKG

979 BJavaScriptView Raw
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 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.getProjectMainFile = void 0;
11const schematics_1 = require("@angular-devkit/schematics");
12const project_targets_1 = require("./project-targets");
13/** Looks for the main TypeScript file in the given project and returns its path. */
14function getProjectMainFile(project) {
15 const buildOptions = project_targets_1.getProjectTargetOptions(project, 'build');
16 if (!buildOptions.main) {
17 throw new schematics_1.SchematicsException(`Could not find the project main file inside of the ` +
18 `workspace config (${project.sourceRoot})`);
19 }
20 return buildOptions.main.toString();
21}
22exports.getProjectMainFile = getProjectMainFile;
23//# sourceMappingURL=project-main-file.js.map
\No newline at end of file