【发布时间】:2021-07-12 11:51:08
【问题描述】:
尝试在 Firebase 上部署我的 React 应用。问题是,在我部署应用程序并连接到默认的“app.web”域后,我不断收到“未找到站点”页面。我按照最初的步骤将应用程序与 parcelJS 捆绑在一起。
但是在最后添加 /index.html 可以解决我的问题。 连接到“firebase.com”域按预期工作,无需在末尾添加“index.html”。
我之前删除的项目可以无缝运行,没有出现此类问题。
是什么导致了这种行为?我可以做些什么来解决它吗?
firebase.json 的内容
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
【问题讨论】: