refactor(compiler): add createAotCompiler
factory
Also adds 2 more methods to the `AotCompilerHost`: - `loadResource` - `resolveFileToImport`
This commit is contained in:

committed by
Chuck Jazdzewski

parent
484119e59f
commit
2235048432
@ -28,6 +28,14 @@ export class MockContext implements NgHostContext {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
readResource(fileName: string): Promise<string> {
|
||||
const result = this.readFile(fileName);
|
||||
if (result == null) {
|
||||
return Promise.reject(new Error(`Resource not found: ${fileName}`));
|
||||
}
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
|
||||
writeFile(fileName: string, data: string): void {
|
||||
const parts = fileName.split('/');
|
||||
const name = parts.pop();
|
||||
|
Reference in New Issue
Block a user