相关疑难解决方法(0)

如何配置Vite的开发服务器出现404错误?

使用 Vite 的开发服务器,如果我尝试访问不存在的 URL(例如localhost:3000/nonexistent/index.html),我会收到404错误。相反,我收到一个200状态代码以及localhost:3000/index.html.

在这种情况下,如何配置 Vite 使其返回 a 404

(这个问题:Serve a 404 page with app created with Vue-CLI非常相似,但与基于 Webpack 的 Vue-CLI 而不是 Vite 相关。)

devserver http-status-code-404 vue.js vite

6
推荐指数
1
解决办法
7061
查看次数

标签 统计

devserver ×1

http-status-code-404 ×1

vite ×1

vue.js ×1