From 2f1a4cda5ce0365fc3272f89f66bacab992c5a4f Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau Date: Wed, 25 Apr 2018 01:00:59 +0200 Subject: [PATCH] webpack: Add Configuration.Resolve.cacheWithContext (#25209) https://webpack.js.org/configuration/resolve/#resolve-cachewithcontext --- types/webpack/index.d.ts | 9 +++++++++ types/webpack/v3/index.d.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 8c93019f24..e422c58b32 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -11,6 +11,7 @@ // Spencer Elliott // Jason Cheatham // Dennis George +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -320,6 +321,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve { diff --git a/types/webpack/v3/index.d.ts b/types/webpack/v3/index.d.ts index 7f943d4151..262b52a286 100644 --- a/types/webpack/v3/index.d.ts +++ b/types/webpack/v3/index.d.ts @@ -10,6 +10,7 @@ // Alan Agius // Spencer Elliott // Jason Cheatham +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -318,6 +319,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve {