This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
packages/ngtools/webpack/src Expand file tree Collapse file tree 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 {
232232 return stats . content ;
233233 }
234234
235- // Does not delegate, use with `fileExists/directoryExists()`.
236- stat ( path : string ) : VirtualStats {
235+ stat ( path : string ) : VirtualStats | null {
237236 const p = this . resolve ( path ) ;
238237 const stats = this . _files [ p ] || this . _directories [ p ] ;
239238 if ( ! stats ) {
240- throw new Error ( `File not found: ${ JSON . stringify ( p ) } ` ) ;
239+ return this . _syncHost . stat ( p ) as VirtualStats | null ;
241240 }
242241
243242 return stats ;
Original file line number Diff line number Diff line change @@ -18,17 +18,16 @@ export class VirtualFileSystemDecorator implements InputFileSystem {
1818 private _webpackCompilerHost : WebpackCompilerHost ,
1919 ) { }
2020
21- // We only need to intercept calls to individual files that are present in WebpackCompilerHost.
2221 private _readFileSync ( path : string ) : string | null {
23- if ( this . _webpackCompilerHost . fileExists ( path , false ) ) {
22+ if ( this . _webpackCompilerHost . fileExists ( path ) ) {
2423 return this . _webpackCompilerHost . readFile ( path ) || null ;
2524 }
2625
2726 return null ;
2827 }
2928
3029 private _statSync ( path : string ) : Stats | null {
31- if ( this . _webpackCompilerHost . fileExists ( path , false ) ) {
30+ if ( this . _webpackCompilerHost . fileExists ( path ) ) {
3231 return this . _webpackCompilerHost . stat ( path ) ;
3332 }
3433
You can’t perform that action at this time.
0 commit comments