File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/@ngtools/webpack/src Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export class AotPlugin implements Tapable {
5151 private _compilerOptions : ts . CompilerOptions ;
5252 private _angularCompilerOptions : any ;
5353 private _program : ts . Program ;
54- private _moduleResolutionCache : ts . ModuleResolutionCache ;
54+ private _moduleResolutionCache ? : ts . ModuleResolutionCache ;
5555 private _rootFilePath : string [ ] ;
5656 private _compilerHost : WebpackCompilerHost ;
5757 private _resourceLoader : WebpackResourceLoader ;
@@ -253,10 +253,12 @@ export class AotPlugin implements Tapable {
253253 this . _rootFilePath , this . _compilerOptions , this . _compilerHost ) ;
254254
255255 // We use absolute paths everywhere.
256- this . _moduleResolutionCache = ts . createModuleResolutionCache (
257- this . _basePath ,
258- ( fileName : string ) => this . _compilerHost . resolve ( fileName ) ,
259- ) ;
256+ if ( ts . createModuleResolutionCache ) {
257+ this . _moduleResolutionCache = ts . createModuleResolutionCache (
258+ this . _basePath ,
259+ ( fileName : string ) => this . _compilerHost . resolve ( fileName ) ,
260+ ) ;
261+ }
260262
261263 // We enable caching of the filesystem in compilerHost _after_ the program has been created,
262264 // because we don't want SourceFile instances to be cached past this point.
You can’t perform that action at this time.
0 commit comments