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 {
51
51
private _compilerOptions : ts . CompilerOptions ;
52
52
private _angularCompilerOptions : any ;
53
53
private _program : ts . Program ;
54
- private _moduleResolutionCache : ts . ModuleResolutionCache ;
54
+ private _moduleResolutionCache ? : ts . ModuleResolutionCache ;
55
55
private _rootFilePath : string [ ] ;
56
56
private _compilerHost : WebpackCompilerHost ;
57
57
private _resourceLoader : WebpackResourceLoader ;
@@ -253,10 +253,12 @@ export class AotPlugin implements Tapable {
253
253
this . _rootFilePath , this . _compilerOptions , this . _compilerHost ) ;
254
254
255
255
// 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
+ }
260
262
261
263
// We enable caching of the filesystem in compilerHost _after_ the program has been created,
262
264
// 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