MCPcopy
hub / github.com/angular/angular-cli / getServerModulePath

Function getServerModulePath

packages/schematics/angular/app-shell/index.ts:40–51  ·  view source on GitHub ↗
(host: Tree, sourceRoot: string, mainPath: string)

Source from the content-addressed store, hash-verified

38}
39
40function getServerModulePath(host: Tree, sourceRoot: string, mainPath: string): string | null {
41 const mainSource = getSourceFile(host, join(sourceRoot, mainPath));
42 const allNodes = getSourceNodes(mainSource);
43 const expNode = allNodes.find((node) => ts.isExportDeclaration(node));
44 if (!expNode) {
45 return null;
46 }
47 const relativePath = expNode.moduleSpecifier as ts.StringLiteral;
48 const modulePath = join(sourceRoot, `${relativePath.text}.ts`);
49
50 return modulePath;
51}
52
53interface TemplateInfo {
54 templateProp?: ts.PropertyAssignment;

Callers 1

addServerRoutingConfigFunction · 0.85

Calls 4

getSourceNodesFunction · 0.90
joinFunction · 0.85
findMethod · 0.80
getSourceFileFunction · 0.70

Tested by

no test coverage detected