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

Function addTsProjectReference

packages/schematics/angular/library/index.ts:58–71  ·  view source on GitHub ↗
(...paths: string[])

Source from the content-addressed store, hash-verified

56}
57
58function addTsProjectReference(...paths: string[]) {
59 return (host: Tree) => {
60 if (!host.exists('tsconfig.json')) {
61 return host;
62 }
63
64 const newReferences = paths.map((path) => ({ path }));
65
66 const file = new JSONFile(host, 'tsconfig.json');
67 const jsonPath = ['references'];
68 const value = file.get(jsonPath);
69 file.modify(jsonPath, Array.isArray(value) ? [...value, ...newReferences] : newReferences);
70 };
71}
72
73function addDependenciesToPackageJson({ skipInstall, testRunner }: LibraryOptions): Rule {
74 return chain([

Callers 1

index.tsFile · 0.70

Calls 3

getMethod · 0.95
modifyMethod · 0.95
existsMethod · 0.65

Tested by

no test coverage detected