Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeffschwartz opened this issue Jun 13, 2023 · 0 comments

Comments

@jeffschwartz
Copy link

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

  • Command line used for launching live-server for non production builds, which work fine because urls do not contain base url:
    npm script - "development:live-server": "live-server build --quiet --entry-file=/404.html"

  • OS: Mac OS

  • Browser (if browser related):

  • Node.js version: 16+

  • live-server version: 1.2.2

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.

@jeffschwartz jeffschwartz changed the title How can I get live-server to serve pages that contain URL that Github Pages requires. How can I get live-server to work with URLs that are prepended with a base URL during production builds? Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant