mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added the id property to RequireContext as described here: https://webpack.js.org/guides/dependency-management/#context-module-api (#36676)
This commit is contained in:
parent
1ff5fa1ba1
commit
128496570a
4
types/webpack-env/index.d.ts
vendored
4
types/webpack-env/index.d.ts
vendored
@ -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 <https://github.com/use-strict>
|
||||
// rhonsby <https://github.com/rhonsby>
|
||||
@ -15,6 +15,8 @@ declare namespace __WebpackModuleApi {
|
||||
(id: string): any;
|
||||
<T>(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 {
|
||||
|
||||
@ -13,6 +13,8 @@ otherModule.otherMethod();
|
||||
let context = require.context('./somePath', true);
|
||||
let contextModule = context<SomeModule>('./someModule');
|
||||
|
||||
const contextId: string = require.context('./somePath').id;
|
||||
|
||||
require(['./someModule', './otherModule'], (someModule: SomeModule, otherModule: any) => {
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user