diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts index c4204c8..bc8c21a 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts @@ -50,7 +50,7 @@ interface WebpackConfigFunc { type WebpackConfigExport = WebpackConfigOrArrayOrThenable | WebpackConfigFunc; type WebpackConfigModuleExports = WebpackConfigExport | EsModuleExports; -function isThenable(obj: any) { +function isThenable(obj: any): obj is Thenable { return obj && typeof (>obj).then === 'function'; } @@ -262,7 +262,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option webpackConfigExport = webpackConfigExport(options.suppliedOptions.EnvParam); } - const webpackConfigThenable = isThenable(webpackConfigExport) + const webpackConfigThenable: Thenable = isThenable(webpackConfigExport) ? webpackConfigExport : { then: callback => callback(webpackConfigExport) };