web
web copied to clipboard
[dev-server] setting basePath substrings prefix from resource url
Setting base path in web-dev-server.config.js trims not just /path/ but also /path/path-to-resource.
This makes links invalid /-to-result.
For now I only found a solution to create a middleware to restore sub-stringed prefix.
Also please consider clearer way of removing base path from urls. Maybe regex instead of a string.
Steps to reproduce:
- set
<base href="/gib/" />inindex.html(js or jsx should work too) - in
web-dev-server.config.jssetbasePath="/gib"("/gib/" seems to be invalid) - try to make request from frontend to
<app.domain>/gib/gib-test.
Expected result:
request url in console wil look like: <app.domain>/gib-test.
Actual (wrong) result:
<app.domain>/-test
It's even worse than that... The NAME_WEB_SOCKET_IMPORT injected js is not a relative path, so it is impossible to make a dev server run behind a reverse proxy.