Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): sockPath for custom path
Browse files Browse the repository at this point in the history
Set devServer.sockPath to connect to reloading socket
via custom path when serving the app on a custom path.
  • Loading branch information
micmro authored and vikerman committed Oct 23, 2019
1 parent 3a38d65 commit e097c56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/angular_devkit/build_angular/src/dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,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}`];
Expand Down

0 comments on commit e097c56

Please sign in to comment.