Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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;
};