feat(compiler): make .ngsummary.json files portable
This also allows to customize the filePaths in `.ngsummary.json` file via the new methods `toSummaryFileName` and `fromSummaryFileName` on the `CompilerHost`.
This commit is contained in:
@@ -130,6 +130,20 @@ export interface CompilerHost extends ts.CompilerHost {
|
||||
* See ImportResolver.
|
||||
*/
|
||||
fileNameToModuleName(importedFilePath: string, containingFilePath: string): string|null;
|
||||
/**
|
||||
* Converts a file name into a representation that should be stored in a summary file.
|
||||
* This has to include changing the suffix as well.
|
||||
* E.g.
|
||||
* `some_file.ts` -> `some_file.d.ts`
|
||||
*
|
||||
* @param referringSrcFileName the soure file that refers to fileName
|
||||
*/
|
||||
toSummaryFileName(fileName: string, referringSrcFileName: string): string;
|
||||
/**
|
||||
* Converts a fileName that was processed by `toSummaryFileName` back into a real fileName
|
||||
* given the fileName of the library that is referrig to it.
|
||||
*/
|
||||
fromSummaryFileName(fileName: string, referringLibFileName: string): string;
|
||||
/**
|
||||
* Load a referenced resource either statically or asynchronously. If the host returns a
|
||||
* `Promise<string>` it is assumed the user of the corresponding `Program` will call
|
||||
|
||||
Reference in New Issue
Block a user