You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite's dev server behaviour for directories is subtly and maddeningly different for directories in root versus directories in publicDir. As described in great detail in the migration guide the behaviour is now consistent between dev and preview for root and depends on the presence of a trailing slash: /dir/ will route to /dir/index.html while /dir will route to /index.html.
For publicDir something else happens, namely that anything that isn't a specifically existing file seems to get routed to /index.html (like a SPA).
This behaviour doesn't seem to be documented anywhere, is inconsistent and not what I, a user, expect :-)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Vite's dev server behaviour for directories is subtly and maddeningly different for directories in
root
versus directories inpublicDir
. As described in great detail in the migration guide the behaviour is now consistent betweendev
and preview forroot
and depends on the presence of a trailing slash:/dir/
will route to/dir/index.html
while/dir
will route to/index.html
.For
publicDir
something else happens, namely that anything that isn't a specifically existing file seems to get routed to/index.html
(like a SPA).This behaviour doesn't seem to be documented anywhere, is inconsistent and not what I, a user, expect :-)
Reproduction
https://github.com/dhdaines/vitebug
Steps to reproduce
npm install
followed bynpm run dev
System Info
Used Package Manager
npm
Logs
Log for /foo/
Log for /bar/
Validations
The text was updated successfully, but these errors were encountered: