diff --git a/types/webpack-env/index.d.ts b/types/webpack-env/index.d.ts index 3677523927..01ef65fc18 100644 --- a/types/webpack-env/index.d.ts +++ b/types/webpack-env/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for webpack (module API) 1.13 +// Type definitions for webpack (module API) 1.14 // Project: https://github.com/webpack/webpack // Definitions by: use-strict // rhonsby @@ -15,6 +15,8 @@ declare namespace __WebpackModuleApi { (id: string): any; (id: string): T; resolve(id: string): string; + /** The module id of the context module. This may be useful for module.hot.accept. */ + id: string; } interface RequireFunction { diff --git a/types/webpack-env/webpack-env-tests.ts b/types/webpack-env/webpack-env-tests.ts index b07a3b632a..1907416c61 100644 --- a/types/webpack-env/webpack-env-tests.ts +++ b/types/webpack-env/webpack-env-tests.ts @@ -13,6 +13,8 @@ otherModule.otherMethod(); let context = require.context('./somePath', true); let contextModule = context('./someModule'); +const contextId: string = require.context('./somePath').id; + require(['./someModule', './otherModule'], (someModule: SomeModule, otherModule: any) => { });