How to use the @angular/compiler-cli.CompilerHost function in @angular/compiler-cli

To help you get started, we’ve selected a few @angular/compiler-cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rangle / angular-ssr / source / application / compiler / program.ts View on Github external
private compilerFactory(context: CompilerHostContext): AngularCompilerHost {
    const hasRoots = this.roots().length > 0;

    if (hasRoots) {
      return new PathMappedCompilerHost(this.program, this.ng, context);
    }

    return new AngularCompilerHost(this.program, this.ng, context);
  }
github rangle / angular-ssr / source / application / compiler / compiler-ng.ts View on Github external
const compilerFactory = (program: Program, options: AngularCompilerOptions, context: NodeCompilerHostContext): CompilerHost => {
  const compiler = rootDirectories(options.basePath, options).length > 0
    ? new PathMappedCompilerHost(program, options, context)
    : new CompilerHost(program, options, context);

  return compiler;
};