-
Notifications
You must be signed in to change notification settings - Fork 370
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature?]: Make paths starting with /
go to the SERVER_BASE_URL
#1383
Comments
/
go to the SERVER_BASE_URL/
go to the SERVER_BASE_URL
/
go to the SERVER_BASE_URL/
go to the SERVER_BASE_URL
Interesting. I wasn't aware of this behavior especially on anchors. We need the base URL to be able to remove it from the path. Like anchors aside the router needs it. Was this something we were doing in our Vite plugin though?.. Because I'd be super surprised if this was default behavior. I guess Vite does a transform on the HTML (their whole index.html thing) and we must have been tapping into that. Thanks this makes is easier to at least understand where the gap is. |
@ryansolid , seem like i remembered wrong - there was no such behavior of injecting base path in anchors in the past, but it would be big dx improvement to have. |
not possible to inject stuff arbitrary outside the html, most of the anchors, imgs, etc are being rendered via the JSX. If they are not |
I don't know how it works, or if JSX is the limiting factor here, but if I look at a project like this Nuxt 3 demo: It has a imageThe two pages Home and About contain images like this: When i run
|
The only way I could see consistently being able to make that transformation is if the image is being imported and then processed as an asset via vite. That could work as it would move it to the assets location and get that interesting hash rewrite. But I don't think we could just parse some arbitrary string. Is that like Nuxt special image component or something? |
Duplicates
Latest version
Summary 馃挕
I have ported a static docs site from an older solid-start-static to the Vinxi version of SolidStart, and what I found was that it's still necessary to append the baseURL virtually everywhere there is an asset or link.
Current situation:
<img>
or favicon needs to manually have appended ${import.meta.env.SERVER_BASE_URL}<Router base={import.meta.env.SERVER_BASE_URL} />
is needed to make the<A />
work<a>
needs the${import.meta.env.SERVER_BASE_URL}/page
.Suggestion:
/page
or/img.png
would contain the baseURL, so that it wouldn't have to be injected in any of these three cases.Examples 馃寛
No response
Motivation 馃敠
No response
The text was updated successfully, but these errors were encountered: