Skip to content

Commit c232e14

Browse files
clydinKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): use query option to set sockJS path in dev-server
Fixes #15002
1 parent a033e50 commit c232e14

File tree

1 file changed

+4
-2
lines changed
  • packages/angular_devkit/build_angular/src/dev-server

1 file changed

+4
-2
lines changed

packages/angular_devkit/build_angular/src/dev-server/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,13 @@ function _addLiveReload(
417417

418418
// If a custom path is provided the webpack dev server client drops the sockjs-node segment.
419419
// This adds it back so that behavior is consistent when using a custom URL path
420+
let sockjsPath = '';
420421
if (clientAddress.pathname) {
421-
clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node');
422+
clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node');
423+
sockjsPath = '&sockPath=' + clientAddress.pathname;
422424
}
423425

424-
const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}`];
426+
const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}${sockjsPath}`];
425427
if (options.hmr) {
426428
const webpackHmrLink = 'https://webpack.js.org/guides/hot-module-replacement';
427429

0 commit comments

Comments
 (0)