mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[webpack-env] Add overload for require.ensure that omits the errorCallback (#39046)
This commit is contained in:
parent
855c080456
commit
47659c6960
1
types/webpack-env/index.d.ts
vendored
1
types/webpack-env/index.d.ts
vendored
@ -34,6 +34,7 @@ declare namespace __WebpackModuleApi {
|
||||
*
|
||||
* This creates a chunk. The chunk can be named. If a chunk with this name already exists, the dependencies are merged into that chunk and that chunk is used.
|
||||
*/
|
||||
ensure(paths: string[], callback: (require: NodeRequire) => void, chunkName?: string): void;
|
||||
ensure(paths: string[], callback: (require: NodeRequire) => void, errorCallback?: (error: any) => void, chunkName?: string): void;
|
||||
context(path: string, deep?: boolean, filter?: RegExp, mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"): RequireContext;
|
||||
/**
|
||||
|
||||
@ -84,5 +84,14 @@ if (module.hot) {
|
||||
module.hot.removeStatusHandler(statusHandler);
|
||||
}
|
||||
|
||||
require.ensure([], (require) => {
|
||||
require("some/module");
|
||||
});
|
||||
|
||||
require.ensure([], (require) => {
|
||||
require("some/module");
|
||||
}, (e) => {}, 'chunkWithErrorHandling')
|
||||
|
||||
require.ensure([], (require) => {
|
||||
require("some/module");
|
||||
}, 'chunkWithoutErrorHandling');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user