MCPcopy Create free account
hub / github.com/angular/components / getProjectMainFile

Function getProjectMainFile

src/cdk/schematics/utils/project-main-file.ts:15–30  ·  view source on GitHub ↗
(project: ProjectDefinition)

Source from the content-addressed store, hash-verified

13
14/** Looks for the main TypeScript file in the given project and returns its path. */
15export function getProjectMainFile(project: ProjectDefinition): Path {
16 const buildOptions = getProjectTargetOptions(project, 'build');
17
18 // `browser` is for the `@angular-devkit/build-angular:application` builder while
19 // `main` is for the `@angular-devkit/build-angular:browser` builder.
20 const mainPath = (buildOptions['browser'] || buildOptions['main']) as Path | undefined;
21
22 if (!mainPath) {
23 throw new SchematicsException(
24 `Could not find the project main file inside of the ` +
25 `workspace config (${project.sourceRoot})`,
26 );
27 }
28
29 return mainPath;
30}

Callers 2

isStandaloneSchematicFunction · 0.90

Calls 1

getProjectTargetOptionsFunction · 0.90

Tested by

no test coverage detected