我有一个我要部署到firebase的react项目,在firebase serve
时可以正常工作,但是我得到类似的信息,因为您已经成功设置了Firebase Hosting,所以看到了这一点。现在该开始构建非凡的东西了! firebase deploy
之后,
为什么会这样?
答案 0 :(得分:0)
答案:我发现了问题。 firebase.json
文件已从更改
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
}
}
对此
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [{ "source": "/service-worker.js", "headers": [{ "key": "Cache-Control", "value": "no-cache" }] }]
}
}
它起作用了,有关更多参考, https://create-react-app.dev/docs/deployment/