mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +08:00
fix(@ngtools/webpack): disable caching for ngcc synchronous Webpack resolver
The ngcc resolver must be synchronous to integrate with TypeScript which is only synchronous. If the Webpack resolver cache option is enabled when creating a resolver, the resolver will become asynchronous after a rebuild due to the internal implementation of the resolver caching. To prevent this change in behavior, caching is disabled for the ngcc resolver. The ngcc resolver is only used the first time each dependency is used by the application.
This commit is contained in:
parent
2e4ee282b3
commit
f2f15c0893
@ -66,6 +66,8 @@ function initializeNgccProcessor(
|
||||
const errors: string[] = [];
|
||||
const warnings: string[] = [];
|
||||
const resolver = compiler.resolverFactory.get('normal', {
|
||||
// Caching must be disabled because it causes the resolver to become async after a rebuild
|
||||
cache: false,
|
||||
extensions: ['.json'],
|
||||
useSyncFileSystemCalls: true,
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user