INNER CODE UNIT · TypeScript

getBrowserDistFolder

maciejtreder/ng-toolkit · schematics/_utils/index.ts:347

export function getBrowserDistFolder(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:browser') {
            return project[property].options.outputPath;
        }
    }

    // Not found for the passed project. Checks the default one
    throw new NgToolkitException('Browser build not found (lack of entry with build-angular:browser builder) in angular.json', { fileContent: cliConfig });
}

export function getDistFolder(tree: Tree, options: any): string {
    let toReturn;
    if (isUniversal(tree, options)) {
        let array = [getServerDistFolder(tree, options), getBrowserDistFolder(tree, options)]
        let A = array.concat().sort(),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…