Merge pull request #3321 from dotnet-maestro-bot/merge/release/2.2-to-master

[automated] Merge branch 'release/2.2' => 'master'
This commit is contained in:
BrennanConroy 2018-11-19 09:58:05 -08:00 committed by GitHub
commit 6c4f7b430a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -8,8 +8,10 @@ import { XhrHttpClient } from "./XhrHttpClient";
let nodeHttpClientModule: any;
if (typeof XMLHttpRequest === "undefined") {
// tslint:disable-next-line:no-var-requires
nodeHttpClientModule = require("./NodeHttpClient");
// In order to ignore the dynamic require in webpack builds we need to do this magic
// @ts-ignore: TS doesn't know about these names
const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
nodeHttpClientModule = requireFunc("./NodeHttpClient");
}
/** Default implementation of {@link @aspnet/signalr.HttpClient}. */

View File

@ -39,10 +39,11 @@ const MAX_REDIRECTS = 100;
let WebSocketModule: any = null;
let EventSourceModule: any = null;
if (typeof window === "undefined" && typeof require !== "undefined") {
// tslint:disable-next-line:no-var-requires
WebSocketModule = require("ws");
// tslint:disable-next-line:no-var-requires
EventSourceModule = require("eventsource");
// In order to ignore the dynamic require in webpack builds we need to do this magic
// @ts-ignore: TS doesn't know about these names
const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
WebSocketModule = requireFunc("ws");
EventSourceModule = requireFunc("eventsource");
}
/** @private */