From 5ab619bcdd40a1aba5a5659618bfa1d3c316031d Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 5 Jul 2019 19:05:08 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): use query option to set sockJS path in dev-server Fixes #15002 --- .../angular_devkit/build_angular/src/dev-server/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/dev-server/index.ts b/packages/angular_devkit/build_angular/src/dev-server/index.ts index f9f39164e260..8eb46933b1e4 100644 --- a/packages/angular_devkit/build_angular/src/dev-server/index.ts +++ b/packages/angular_devkit/build_angular/src/dev-server/index.ts @@ -417,11 +417,13 @@ function _addLiveReload( // If a custom path is provided the webpack dev server client drops the sockjs-node segment. // This adds it back so that behavior is consistent when using a custom URL path + let sockjsPath = ''; if (clientAddress.pathname) { - clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node'); + clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node'); + sockjsPath = '&sockPath=' + clientAddress.pathname; } - const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}`]; + const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}${sockjsPath}`]; if (options.hmr) { const webpackHmrLink = 'https://webpack.js.org/guides/hot-module-replacement';