INNER CODE UNIT · TypeScript
getServerDistFolder
maciejtreder/ng-toolkit · schematics/_utils/index.ts:312
export function getServerDistFolder(tree: Tree, options: any): string {
const cliConfig: WorkspaceSchema = JSON.parse(getFileContent(tree, `${options.directory}/angular.json`));
const project: WorkspaceTargets<ProjectType.Application> | undefined = cliConfig.projects[options.clientProject].architect;
for (let property in project) {
if (project.hasOwnProperty(property) && project[property].builder === '@angular-devkit/build-angular:server') {
return project[property].options.outputPath;
}
}
return '';
}
export function updateProject(tree: Tree, options: any): void {
const cliConfig: WorkspaceSchema = JSON.parse(getFileContent(tree, `${options.directory}/angular.json`));
const project: WorkspaceTargets<ProjectType.Application> | undefined = cliConfig.projects[options.clientProject].architect;
for (let property in project) {
if (project.hasOwnProperty(property) && project[property].builder === '@angular-devkit/build-angular:browser') {
console.log(`\u001B[33mINFO: \u001b[0mProject property is set to '${options.clientProject}'.`);
return;