@@ -135,15 +135,20 @@ export class WebpackCompilerHost implements ts.CompilerHost {
135
135
return ;
136
136
}
137
137
138
+ const isWindows = process . platform . startsWith ( 'win' ) ;
138
139
for ( const fileName of Object . keys ( this . _files ) ) {
139
140
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, '\\' ) : fileName ;
143
+ fs . _statStorage . data [ path ] = [ null , stats ] ;
144
+ fs . _readFileStorage . data [ path ] = [ null , stats . content ] ;
142
145
}
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, '\\' ) : dirName ;
147
152
fs . _statStorage . data [ path ] = [ null , stats ] ;
148
153
fs . _readdirStorage . data [ path ] = [ null , files . concat ( dirs ) ] ;
149
154
}
@@ -215,7 +220,7 @@ export class WebpackCompilerHost implements ts.CompilerHost {
215
220
onError ?: ( message : string ) => void , sourceFiles ?: ts . SourceFile [ ] ) : void => {
216
221
fileName = this . _resolve ( fileName ) ;
217
222
this . _setFileContent ( fileName , data ) ;
218
- }
223
+ } ;
219
224
}
220
225
221
226
getCurrentDirectory ( ) : string {
0 commit comments