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 {
5050 private _compilerOptions : ts . CompilerOptions ;
5151 private _angularCompilerOptions : any ;
5252 private _program : ts . Program ;
53- private _moduleResolutionCache : ts . ModuleResolutionCache ;
53+ private _moduleResolutionCache ? : ts . ModuleResolutionCache ;
5454 private _rootFilePath : string [ ] ;
5555 private _compilerHost : WebpackCompilerHost ;
5656 private _resourceLoader : WebpackResourceLoader ;
@@ -225,9 +225,11 @@ export class AotPlugin implements Tapable {
225225 this . _program = ts . createProgram (
226226 this . _rootFilePath , this . _compilerOptions , this . _compilerHost ) ;
227227
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+ }
231233
232234 // We enable caching of the filesystem in compilerHost _after_ the program has been created,
233235 // 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