@@ -524,7 +524,7 @@ ${indentText}${text}`;
524524
525525 export const version = "FakeTSVersion" ;
526526
527- export function patchSolutionBuilderHost ( host : ts . SolutionBuilderHost < ts . BuilderProgram > , sys : System ) {
527+ export function patchHostForBuildInfoReadWrite ( host : ts . CompilerHost | ts . SolutionBuilderHost < ts . BuilderProgram > ) {
528528 const originalReadFile = host . readFile ;
529529 host . readFile = ( path , encoding ) => {
530530 const value = originalReadFile . call ( host , path , encoding ) ;
@@ -537,14 +537,18 @@ ${indentText}${text}`;
537537
538538 if ( host . writeFile ) {
539539 const originalWriteFile = host . writeFile ;
540- host . writeFile = ( fileName , content , writeByteOrderMark ) => {
540+ host . writeFile = ( fileName : string , content : string , writeByteOrderMark : boolean ) => {
541541 if ( ! ts . isBuildInfoFile ( fileName ) ) return originalWriteFile . call ( host , fileName , content , writeByteOrderMark ) ;
542542 const buildInfo = ts . getBuildInfo ( content ) ;
543543 sanitizeBuildInfoProgram ( buildInfo ) ;
544544 buildInfo . version = version ;
545545 originalWriteFile . call ( host , fileName , ts . getBuildInfoText ( buildInfo ) , writeByteOrderMark ) ;
546546 } ;
547547 }
548+ }
549+
550+ export function patchSolutionBuilderHost ( host : ts . SolutionBuilderHost < ts . BuilderProgram > , sys : System ) {
551+ patchHostForBuildInfoReadWrite ( host ) ;
548552
549553 ts . Debug . assert ( host . now === undefined ) ;
550554 host . now = ( ) => new Date ( sys . vfs . time ( ) ) ;
0 commit comments