This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree 2 files changed +4
-6
lines changed
packages/ngtools/webpack/src
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -232,12 +232,11 @@ export class WebpackCompilerHost implements ts.CompilerHost {
232
232
return stats . content ;
233
233
}
234
234
235
- // Does not delegate, use with `fileExists/directoryExists()`.
236
- stat ( path : string ) : VirtualStats {
235
+ stat ( path : string ) : VirtualStats | null {
237
236
const p = this . resolve ( path ) ;
238
237
const stats = this . _files [ p ] || this . _directories [ p ] ;
239
238
if ( ! stats ) {
240
- throw new Error ( `File not found: ${ JSON . stringify ( p ) } ` ) ;
239
+ return this . _syncHost . stat ( p ) as VirtualStats | null ;
241
240
}
242
241
243
242
return stats ;
Original file line number Diff line number Diff line change @@ -18,17 +18,16 @@ export class VirtualFileSystemDecorator implements InputFileSystem {
18
18
private _webpackCompilerHost : WebpackCompilerHost ,
19
19
) { }
20
20
21
- // We only need to intercept calls to individual files that are present in WebpackCompilerHost.
22
21
private _readFileSync ( path : string ) : string | null {
23
- if ( this . _webpackCompilerHost . fileExists ( path , false ) ) {
22
+ if ( this . _webpackCompilerHost . fileExists ( path ) ) {
24
23
return this . _webpackCompilerHost . readFile ( path ) || null ;
25
24
}
26
25
27
26
return null ;
28
27
}
29
28
30
29
private _statSync ( path : string ) : Stats | null {
31
- if ( this . _webpackCompilerHost . fileExists ( path , false ) ) {
30
+ if ( this . _webpackCompilerHost . fileExists ( path ) ) {
32
31
return this . _webpackCompilerHost . stat ( path ) ;
33
32
}
34
33
You can’t perform that action at this time.
0 commit comments