【发布时间】:2016-09-12 21:35:53
【问题描述】:
我是在 Firebase 上托管 React 应用程序的新手,因此我们将不胜感激。我已经按照 Firebase.com 上新 v3 文档的说明进行操作,但我不确定将哪些资产/文件放入我的公共目录。我觉得文档在这方面非常模糊。
这是我的 Firebase.json:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
我的目录结构如下:
Name of App
-build
-css
-node_modules
-public
-scripts
.firebaserc
database.rules.json
firebase.json
gulpfile.js
index.html
package.json
README.md
我已经尝试将父目录的全部内容复制到公用文件夹中,但没有成功。任何帮助将不胜感激。
【问题讨论】:
-
你能把你的问题说得更具体一些吗?不清楚你的问题是什么。
-
@MatthewHerbst 我基本上不知道如何让我的 react 应用程序使用 firebase v3 托管,以及哪些文件要包含到公共目录中。我与 firebase 的支持人员进行了交谈,他们说将所有内容都转储到公共目录中无济于事。这是我的 index.html 参考:imgur.com/a/NGgtE 例如,我想要的只是我需要包含/不包含的所有文件的列表。我应该包含 .json 文件吗?我的 gulpfile.js?我想我至少需要我的 css 和脚本目录以及 index.html
标签: reactjs firebase firebase-hosting