File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/@ngtools/webpack/src Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class AotPlugin implements Tapable {
50
50
private _compilerOptions : ts . CompilerOptions ;
51
51
private _angularCompilerOptions : any ;
52
52
private _program : ts . Program ;
53
- private _moduleResolutionCache : ts . ModuleResolutionCache ;
53
+ private _moduleResolutionCache ? : ts . ModuleResolutionCache ;
54
54
private _rootFilePath : string [ ] ;
55
55
private _compilerHost : WebpackCompilerHost ;
56
56
private _resourceLoader : WebpackResourceLoader ;
@@ -225,9 +225,11 @@ export class AotPlugin implements Tapable {
225
225
this . _program = ts . createProgram (
226
226
this . _rootFilePath , this . _compilerOptions , this . _compilerHost ) ;
227
227
228
- // We use absolute paths everywhere.
229
- this . _moduleResolutionCache = ts . createModuleResolutionCache (
230
- this . _basePath , ( fileName : string ) => fileName ) ;
228
+ if ( ts . createModuleResolutionCache ) {
229
+ // We use absolute paths everywhere.
230
+ this . _moduleResolutionCache = ts . createModuleResolutionCache (
231
+ this . _basePath , ( fileName : string ) => fileName ) ;
232
+ }
231
233
232
234
// We enable caching of the filesystem in compilerHost _after_ the program has been created,
233
235
// 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