-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support "base" config of Vite or alternatives #243
Comments
Hi @berlysia I don't understand your problem 100%, but will it be resolved if you change the path honox/src/server/components/script.tsx Line 18 in f2094e3
|
Hi @yusukebe , thank you for your response. The problem occurs because the .js file references in each HTML are written as root-relative paths. If the deployment destination is a subpath (e.g., GitHub Pages), the subpath segment must be included when referencing root-relative paths. When deploying to https://example.com/path/to/some/dir/, the following mismatch arises, causing the .js file to fail to load:
Note that .js files themselves are unaffected because they use relative paths. We will probably do something around manifest.json, but at least we should avoid rewriting manifest.json. We want to keep compatibility with good tools in the Vite ecosystem, right? This issue can be resolved simply by replacing the hardcoded For embedded deployments (the default behavior in bare Vite when Empedded deployment improves the reusability of build results, allowing us to build artifacts once and place them in multiple different subpaths.
|
Hi @berlysia Thank you for the helpful explanation and the PR!
It's correct. We should not edit a I'm working on reviewing your PR. Please wait a bit! |
What is the feature you are proposing?
When client code is present, it is not possible to deploy a site built with HonoX to GitHub Pages.
When deploying a site built with Vite to GitHub Pages, it is instructed to change the
base
setting.Behavior for embedded deployments is also provided.
FYI: My workaround and considerations:
"/"
, so it is not configurable.base
value is shared by environment variables.The text was updated successfully, but these errors were encountered: