tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.4k stars 484 forks source link

How can I get live-server to work with URLs that are prepended with a base URL during production builds? #412

Open jeffschwartz opened 1 year ago

jeffschwartz commented 1 year ago
Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting

Issue description

How can I configure live-server with an npm script to serve pages that contain a base url.

Software details

I am trying to serve both development and production builds from the "build" folder, which is the root of my site. Development and production builds only differ in that production urls are prepended with a base url segment, meaning {baseURL}/someurl.html where as development urls would be generated as /someurl.html.

I have tried using --base for production builds, as in: npm script - "release:live-server": "live-server build --base="somebaseurl" --quiet --entry-file=/404.html" but it doesn't work at all.