Skip to content

Commit

Permalink
fix(builders): only remove reload script leading slash when having a …
Browse files Browse the repository at this point in the history
…public host with a path name

We should only remove the leading slash of BrowserSync script when having a public host with a path name, this will other cause the browser sync script not to be found when using a base href.

Closes #1495
  • Loading branch information
alan-agius4 committed Feb 19, 2020
1 parent 78eeb9f commit 281a3c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/builders/src/ssr-dev-server/index.ts
Expand Up @@ -234,8 +234,6 @@ async function initBrowserSync(
ghostMode: false,
logLevel: 'silent',
open,
// Remove leading slash
scriptPath: path => path.substring(1),
};

const publicHostNormalized = publicHost && publicHost.endsWith('/')
Expand Down Expand Up @@ -265,6 +263,8 @@ async function initBrowserSync(
// However users will typically have a reverse proxy that will redirect all matching requests
// ex: http://testinghost.com/ssr -> http://localhost:4200 which will result in a 404.
if (hasPathname) {
// Remove leading slash
bsOptions.scriptPath = p => p.substring(1),
bsOptions.middleware = [
proxy(defaultSocketIoPath, {
target: url.format({
Expand Down

0 comments on commit 281a3c8

Please sign in to comment.