web icon indicating copy to clipboard operation
web copied to clipboard

[@web/dev-server]Live-reload, HMR not working when app is running on a base URL like <base href="/my-app/">

Open acory opened this issue 4 years ago • 2 comments

In __web-dev-server_web-socket.js file there is this code:

const { protocol, host } = new URL(import.meta.url);
const webSocketUrl = `ws${protocol === 'https:' ? 's' : ''}://${host}/wds`;

It would be nice if I can specify in the web-dev-server.config a baseUrl and have the code above rewritten to:

const webSocketUrl = `ws${protocol === 'https:' ? 's' : ''}://${host}/**${app-base-href}**/wds`

I need this, so traefik can route the request to the appropriate docker container.

acory avatar Jun 02 '21 20:06 acory

I'm close to making HMR work in my project, but I can't figure out why the __web-de-server__ folder (with the hmr scripts) is missing. hmr-folder @LarsDenBakker any tip? or point to the file/line of code that I should pay attention to?

acory avatar Nov 24 '21 19:11 acory