From 5260bbb9a3d17aefb90bcf1b660e252996cf68df Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Oct 2019 12:22:46 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): sockPath for custom path Set devServer.sockPath to connect to reloading socket via custom path when serving the app on a custom path. --- packages/angular_devkit/build_angular/src/dev-server/index.ts | 4 ++++ 1 file changed, 4 insertions(+) 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 816ba06c7bfd..c2c65f6b230a 100644 --- a/packages/angular_devkit/build_angular/src/dev-server/index.ts +++ b/packages/angular_devkit/build_angular/src/dev-server/index.ts @@ -423,6 +423,10 @@ function _addLiveReload( if (clientAddress.pathname) { clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node'); sockjsPath = '&sockPath=' + clientAddress.pathname; + // ensure webpack-dev-server uses the correct path to connect to the reloading socket + if (webpackConfig.devServer) { + webpackConfig.devServer.sockPath = clientAddress.pathname; + } } const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}${sockjsPath}`];