Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 281a3c8

Browse files
committed
fix(builders): only remove reload script leading slash when having a 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
1 parent 78eeb9f commit 281a3c8

File tree

1 file changed

+2
-2
lines changed
  • modules/builders/src/ssr-dev-server

1 file changed

+2
-2
lines changed

modules/builders/src/ssr-dev-server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ async function initBrowserSync(
234234
ghostMode: false,
235235
logLevel: 'silent',
236236
open,
237-
// Remove leading slash
238-
scriptPath: path => path.substring(1),
239237
};
240238

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

0 commit comments

Comments
 (0)