@@ -524,7 +524,7 @@ ${indentText}${text}`;
524
524
525
525
export const version = "FakeTSVersion" ;
526
526
527
- export function patchSolutionBuilderHost ( host : ts . SolutionBuilderHost < ts . BuilderProgram > , sys : System ) {
527
+ export function patchHostForBuildInfoReadWrite ( host : ts . CompilerHost | ts . SolutionBuilderHost < ts . BuilderProgram > ) {
528
528
const originalReadFile = host . readFile ;
529
529
host . readFile = ( path , encoding ) => {
530
530
const value = originalReadFile . call ( host , path , encoding ) ;
@@ -537,14 +537,18 @@ ${indentText}${text}`;
537
537
538
538
if ( host . writeFile ) {
539
539
const originalWriteFile = host . writeFile ;
540
- host . writeFile = ( fileName , content , writeByteOrderMark ) => {
540
+ host . writeFile = ( fileName : string , content : string , writeByteOrderMark : boolean ) => {
541
541
if ( ! ts . isBuildInfoFile ( fileName ) ) return originalWriteFile . call ( host , fileName , content , writeByteOrderMark ) ;
542
542
const buildInfo = ts . getBuildInfo ( content ) ;
543
543
sanitizeBuildInfoProgram ( buildInfo ) ;
544
544
buildInfo . version = version ;
545
545
originalWriteFile . call ( host , fileName , ts . getBuildInfoText ( buildInfo ) , writeByteOrderMark ) ;
546
546
} ;
547
547
}
548
+ }
549
+
550
+ export function patchSolutionBuilderHost ( host : ts . SolutionBuilderHost < ts . BuilderProgram > , sys : System ) {
551
+ patchHostForBuildInfoReadWrite ( host ) ;
548
552
549
553
ts . Debug . assert ( host . now === undefined ) ;
550
554
host . now = ( ) => new Date ( sys . vfs . time ( ) ) ;
0 commit comments