@@ -135,15 +135,20 @@ export class WebpackCompilerHost implements ts.CompilerHost {
135135 return ;
136136 }
137137
138+ const isWindows = process . platform . startsWith ( 'win' ) ;
138139 for ( const fileName of Object . keys ( this . _files ) ) {
139140 const stats = this . _files [ fileName ] ;
140- fs . _statStorage . data [ fileName ] = [ null , stats ] ;
141- fs . _readFileStorage . data [ fileName ] = [ null , stats . content ] ;
141+ // If we're on windows, we need to populate with the proper path separator.
142+ const path = isWindows ? fileName . replace ( / \/ / g, '\\' ) ;
143+ fs . _statStorage . data [ path ] = [ null , stats ] ;
144+ fs . _readFileStorage . data [ path ] = [ null , stats . content ] ;
142145 }
143- for ( const path of Object . keys ( this . _directories ) ) {
144- const stats = this . _directories [ path ] ;
145- const dirs = this . getDirectories ( path ) ;
146- const files = this . getFiles ( path ) ;
146+ for ( const dirName of Object . keys ( this . _directories ) ) {
147+ const stats = this . _directories [ dirName ] ;
148+ const dirs = this . getDirectories ( dirName ) ;
149+ const files = this . getFiles ( dirName ) ;
150+ // If we're on windows, we need to populate with the proper path separator.
151+ const path = isWindows ? dirName . replace ( / \/ / g, '\\' ) ;
147152 fs . _statStorage . data [ path ] = [ null , stats ] ;
148153 fs . _readdirStorage . data [ path ] = [ null , files . concat ( dirs ) ] ;
149154 }
0 commit comments