Skip to content

[0.8.x] Fix base #207

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

Closed
wants to merge 2 commits into from
Closed

[0.8.x] Fix base #207

wants to merge 2 commits into from

Conversation

Madscientiste
Copy link

@Madscientiste Madscientiste commented Mar 14, 2023

Fixes what i have mentionned in #197

when i set my vite.config with base: '/something/'
i expect also to have http://172.26.80.1:7894/something in my hotfile
...
If you specify a base path to vite, it means all the assets will be served from that base path. so if you have a base path of /somebasepath then all the assets will be served from http://localhost:3000/somebasepath/asset.js instead of http://localhost:3000/asset.js. This is useful if you want to serve vite from a subpath of your domain.

If i set a basepath and goes to the url without the base path it returns this:

The server is configured with a public base URL of /admin/ - 
did you mean to visit <a href="[/admin/@vite/client](view-source:http://localhost:7894/admin/@vite/client)">/admin/@vite/client</a> instead?

for some reason it doesn't stop my assets to load, but it breaks HMR

@timacdonald timacdonald marked this pull request as draft December 10, 2023 23:26
@timacdonald timacdonald changed the title fix: resolveDevServerUrl appends config.base if set [0.8.x] Fix base Dec 13, 2023
@jessarcher
Copy link
Member

Sorry for the delay in getting to this one. It's a hard one to get my head around and make sure it doesn't introduce a breaking change, given all the different configurations we're trying to support and how base is set differently in dev mode vs build mode.

We recently merged #255, which hasn't been tagged yet but I think will allow you to solve your scenario. Feel free to re-open if it's not the case.

@timacdonald
Copy link
Member

Related: #290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants