Closed zheung closed 1 day ago
Your reproduction shows 404.
This section of the official guide supports my view: Align dev and preview HTML serving behaviour
I don't think so. Quoting the related rows of the table in that docs:
Request | Before (dev) | Before (preview) | After (dev & preview) |
---|---|---|---|
/dir |
/index.html (SPA fallback) |
/dir/index.html |
/index.html (SPA fallback) |
/dir/ |
/dir/index.html |
/dir/index.html |
/dir/index.html |
If I expand your expectation table, it will be:
Request | Your Expectation | Current |
---|---|---|
/ | /index.html | /index.html |
/a | /a/index.html | /index.html |
/a/ | - | /a/index.html |
/a/index.html | /a/index.html | /a/index.html |
/a/b | /a/b/index.html | /index.html |
/a/b/ | - | /a/b/index.html |
a/b/index.html | /a/b/index.html | /a/b/index.html |
The best way does not exist here as all hosting providers' behavior differs: https://github.com/slorber/trailing-slash-guide The current behavior is what we thought the safest.
Your reproduction shows 404.
This section of the official guide supports my view: Align dev and preview HTML serving behaviour
I don't think so. Quoting the related rows of the table in that docs:
Request Before (dev) Before (preview) After (dev & preview)
/dir
/index.html
(SPA fallback)/dir/index.html
/index.html
(SPA fallback)/dir/
/dir/index.html
/dir/index.html
/dir/index.html
If I expand your expectation table, it will be:Request Your Expectation Current / /index.html /index.html /a /a/index.html
/index.html
/a/ -/a/index.html
/a/index.html /a/index.html /a/index.html /a/b /a/b/index.html/index.html
/a/b/ -/a/b/index.html
a/b/index.html /a/b/index.html /a/b/index.html The best way does not exist here as all hosting providers' behavior differs: https://github.com/slorber/trailing-slash-guide The current behavior is what we thought the safest.
reproduction link has been fixed, refresh issuse pls.
Your reproduction shows 404.
This section of the official guide supports my view: Align dev and preview HTML serving behaviour
I don't think so. Quoting the related rows of the table in that docs:
Request Before (dev) Before (preview) After (dev & preview)
/dir
/index.html
(SPA fallback)/dir/index.html
/index.html
(SPA fallback)/dir/
/dir/index.html
/dir/index.html
/dir/index.html
If I expand your expectation table, it will be:Request Your Expectation Current / /index.html /index.html /a /a/index.html
/index.html
/a/ -/a/index.html
/a/index.html /a/index.html /a/index.html /a/b /a/b/index.html/index.html
/a/b/ -/a/b/index.html
a/b/index.html /a/b/index.html /a/b/index.html The best way does not exist here as all hosting providers' behavior differs: https://github.com/slorber/trailing-slash-guide The current behavior is what we thought the safest.
Oh this is my fault. Other mistakes in my actual project and not reading that quoted document carefully led me to the wrong conclusion. Thanks for the answer!
Describe the bug
In latest version
5.4.11
, under dev, ifindex.html
is missing from the preview path, entry points could not fallback to correspondingindex.html
. It always fallbacks toindex.html
in the root.Minimal vite config:
/index.html
/index.html
The link for reproduction is also ready.
Although adding
index.html
to the end of the path is fine for previewing and debugging. But I don't think it's very intuitive to use. This section of the official guide supports my view: Align dev and preview HTML serving behaviourReproduction
https://stackblitz.com/edit/vitejs-vite-n8tdia?file=vite.config.js
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations