MCPcopy Index your code
hub / github.com/angular/angular-cli / updateTsConfigFile

Function updateTsConfigFile

packages/schematics/angular/server/index.ts:122–139  ·  view source on GitHub ↗
(tsConfigPath: string)

Source from the content-addressed store, hash-verified

120}
121
122function updateTsConfigFile(tsConfigPath: string): Rule {
123 return (host: Tree) => {
124 const json = new JSONFile(host, tsConfigPath);
125 // Skip adding the files entry if the server entry would already be included.
126 const include = json.get(['include']);
127 if (!Array.isArray(include) || !include.includes('src/**/*.ts')) {
128 const filesPath = ['files'];
129 const files = new Set((json.get(filesPath) as string[] | undefined) ?? []);
130 files.add('src/' + serverMainEntryName);
131 json.modify(filesPath, [...files]);
132 }
133
134 const typePath = ['compilerOptions', 'types'];
135 const types = new Set((json.get(typePath) as string[] | undefined) ?? []);
136 types.add('node');
137 json.modify(typePath, [...types]);
138 };
139}
140
141function addDependencies(skipInstall: boolean | undefined): Rule {
142 return (host: Tree) => {

Callers 1

index.tsFile · 0.85

Calls 3

getMethod · 0.95
modifyMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected