如何在 Firebase 托管上部署 React 应用程序

问题描述 投票:0回答:1

如何在 Firebase 托管上部署 React 应用程序。当我使用 firebase init 时,它会创建一个“公共”页面和一个“index.html”文件,但部署后访问该页面时不会出现任何内容。我将所有文件夹放在“public”中并启动了 firebase 部署,但它仍然不起作用。

javascript html reactjs node.js firebase
1个回答
0
投票

当 firebase 询问您要使用哪个文件夹时,不要使用 public,而是使用 build。

您想使用什么作为您的公共目录? 构建

配置为单页应用程序(将所有网址重写为/index.html)? 是的

参考:https://www.freecodecamp.org/news/how-to-deploy-a-react-app-with-firebase/

© www.soinside.com 2019 - 2024. All rights reserved.