Merge pull request #26298 from tlaziuk/koa-webpack

[koa-webpack] add close method
This commit is contained in:
Armando Aguirre
2018-06-06 13:09:47 -07:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
// Type definitions for koa-webpack 5.x
// Project: https://github.com/shellscape/koa-webpack#readme
// Type definitions for koa-webpack 5.0
// Project: https://github.com/shellscape/koa-webpack
// Definitions by: Luka Maljic <https://github.com/malj>
// Lee Benson <https://github.com/leebenson>
// miZyind <https://github.com/miZyind>
// Tomek Łaziuk <https://github.com/tlaziuk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -25,11 +26,15 @@ declare namespace koaWebpack {
interface CombinedWebpackMiddleware {
devMiddleware: webpackDevMiddleware.WebpackDevMiddleware;
/**
* @todo make this a `webpack-hot-client@^4.0.0` instance, no typings for v4 available yet
*/
hotClient: {
close: () => void;
options: webpackHotClient.Options;
server: any;
};
close(callback?: () => any): void;
}
}

View File

@@ -53,4 +53,9 @@ koaWebpack({
middleware.hotClient.close();
middleware.hotClient.options;
middleware.hotClient.server;
// close the middleware
middleware.close(() => {
console.log('closed');
});
});