【发布时间】:2018-11-05 19:05:19
【问题描述】:
我正在尝试将我的 Angular 应用部署到 Firebase。
当我执行此操作时,我会转到托管 URL,我收到大量 404 错误(runtime.js、build.js 等)和一个空白页面
我不明白为什么,我做到了:
firebase init
chose storage/firestore/hosting
ng build
firebase deploy
当我做火力服务时,它正在工作......这很奇怪
(ps:角度 6.0.3,firebase 5.0.4)
我的 firebase.json(我必须添加 /hello 我的项目名称,因为 ng build in dist/hello -> "outputPath": "dist/hello",)
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"hosting": {
"public": "dist/hello",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
},
"storage": {
"rules": "storage.rules"
}
}
【问题讨论】:
-
分享你的
firebase.json -
更新了我的帖子,我的 angular.json 输出路径是 "outputPath": "dist/hello",
-
非常感谢它的工作原理!
-
你能标记我的答案吗
标签: angular firebase deployment hosting google-cloud-firestore