yandeu / five-server

⚡ Development Server with Live Reload Capability. (Maintained Fork of Live Server)
https://www.npmjs.com/package/five-server
Other
165 stars 14 forks source link

Paths in HTML aren't resolved relative to --open=PATH #13

Closed feljx closed 3 years ago

feljx commented 3 years ago

When using the --open=PATH option, for example if serving from src folder, paths in index.html aren't resolved relative to src. E.g. <link rel="stylesheet" type="text/css" href="styles.css" media="screen" /> will not find the CSS file because it is not located at root but under src.

live-server does this automatically. Unfortunately this prevents me from using the module. :/

yandeu commented 3 years ago

open is only for opening the browser. You have to set root for this.

Also, have a look at /src/types.ts.

feljx commented 3 years ago

Thanks, that exactly what I needed. :)