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

Function addDependencies

packages/schematics/angular/server/index.ts:141–165  ·  view source on GitHub ↗
(skipInstall: boolean | undefined)

Source from the content-addressed store, hash-verified

139}
140
141function addDependencies(skipInstall: boolean | undefined): Rule {
142 return (host: Tree) => {
143 const coreDep = getPackageJsonDependency(host, '@angular/core');
144 if (coreDep === null) {
145 throw new SchematicsException('Could not find version.');
146 }
147
148 const install = skipInstall ? InstallBehavior.None : InstallBehavior.Auto;
149
150 return chain([
151 addDependency('@angular/ssr', latestVersions.AngularSSR, {
152 type: DependencyType.Default,
153 install,
154 }),
155 addDependency('@angular/platform-server', coreDep.version, {
156 type: DependencyType.Default,
157 install,
158 }),
159 addDependency('@types/node', latestVersions['@types/node'], {
160 type: DependencyType.Dev,
161 install,
162 }),
163 ]);
164 };
165}
166
167const serverSchematic: RuleFactory<ServerOptions> = createProjectSchematic(
168 async (options, { project, tree }) => {

Callers 1

index.tsFile · 0.70

Calls 3

getPackageJsonDependencyFunction · 0.90
chainFunction · 0.90
addDependencyFunction · 0.90

Tested by

no test coverage detected