BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.19k stars 757 forks source link

DEFECT: `scriptPath` non-functional #2090

Open enspritz opened 2 months ago

enspritz commented 2 months ago

Issue details

scriptPath configuration option indeed changes the URL written into returned HTML documents, but the script is still only available at its default/original URL and not at the URL configured by scriptPath.

Steps to reproduce/test case

  1. Start BrowserSync with the following configuration:
    browser_sync.init({
                          scriptPath: (path) => "/abc" + path,
                      });
  2. Load an otherwise properly-functioning page in the browser without caching.
  3. In dev tools Network tab, note that the browser attempted to GET BrowserSync's configured URL at the correct URL i.e. http://localhost:8080/abc/browser-sync/browser-sync-client.js?v=3.0.3, but BrowserSync responded with 404.
  4. Attempts to GET the client script at its default/original URL succeed, also presumably incorrect. I.e. http://localhost:8080/browser-sync/browser-sync-client.js?v=3.0.3

Please specify which version of Browsersync, node and npm you're running

Affected platforms

Browsersync use-case

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

(As in step 1 above)

** It caught my attention that the TypeScript files of the configuration settings seem to differ slightly from the public documentation in that there is scriptPaths instead of scriptPath, and possibly changes for middleware too...