Depolyment Steps
- Check Basepath
<BrowserRouter basename="/my-app/"
- Build Optimize Project
npm run build in create-react-app project
- Server must ALWAYS serve index.html (also for 404 cases)
To ensure that Routing works correctly
- Upload Build Artifacts to (static) Server
In /build folder when using create-react-app
部署在firebase中
npm install -g firebase-tools

React应用部署与优化
本文详细介绍了如何在Create React App项目中使用npm run build进行构建优化,并确保在部署到Firebase时,Routing正确工作,包括设置Basepath和上传Build Artifacts到静态服务器。
1717

被折叠的 条评论
为什么被折叠?



