-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Relative links not handled properly in nested html files #4517
Comments
do not set base, then url will be absolute, and it will work. |
Yeah, that can work as a workaround. Empty |
empty base is not the same as the default value "/", and according to the docs, the nested MPA use case does not set base option which make its value default |
The docs doesn't say |
hi @dejour i also have this problem and i set the base to empty string because i need to upload dist folder to a subfolder inside a domain, so i cannot use absolute path, do you have any idea? |
Fixed by #7644. |
Describe the bug
Vite doesn't handle relative URLs when generating nested html files. Given the following file structure
links in
nested/index.html
should bebut is
Reproduction
npm init vite@latest
usingvanilla
preset,npm install
etc.index.html
tonested/index.html
.vite.config.js
file, set thebase
to""
and follow the offical example for MPA:npm run build
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: