【发布时间】:2020-05-18 12:38:35
【问题描述】:
我有这三个文件:
../project/public/index.html
../project/css/style.css
../project/js/func.js
我已经在“index.html”中正确链接了“style.css”和“func.js”文件,当我在本地测试它时一切正常,但是当我在firebase上部署这个项目时只有“index.html”已部署,网站无法正常工作。如果我将所有三个文件都放在公共目录中,则所有三个文件都已部署并且网站可以正常工作。 这就是 firebase.json 的样子
"hosting": [
{
"target": "publicWeb",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
如果将这三个文件放在不同的目录中,我该如何部署它们?这就是我在“index.html”中链接文件的方式
<script src="../js/func.js"></script>
<link rel="stylesheet" href="../css/style.css">
【问题讨论】:
标签: javascript html firebase web-deployment firebase-hosting