简体   繁体   English

如何准备 CRA 应用程序以部署到 heroku,我还需要像构建全栈 CRA 应用程序一样构建吗?

[英]How do I prepare a CRA app to deploy to heroku, do I still have to build as for a fullstack CRA app?

I have a simple create-react-app app that I want to deploy to heroku but I'm not sure about the right wat to deplay or what files exactly.我有一个简单的 create-react-app 应用程序,我想将它部署到 heroku 但我不确定要播放的正确 wat 或确切的文件。 Do I need to npm run build as in the case of a mern fullstack app?我是否需要npm run build ,就像 mern 全栈应用程序一样? I repeat, this is only react, no server.我再说一遍,这只是反应,没有服务器。 Thank you.谢谢你。

Instead of using Heroku to deploy just the React part, no server, you can use other easier solutions like: Netlify and Vercel .除了使用 Heroku 来部署 React 部分,没有服务器,您可以使用其他更简单的解决方案,例如: NetlifyVercel

What you need need to do that, is just have a GitHub/GitLab repository, register on the platform, choose your repository and wait:)你需要做的只是拥有一个 GitHub/GitLab 存储库,在平台上注册,选择你的存储库并等待:)

It will automatically build and serve your React application.它将自动构建和服务您的 React 应用程序。

Another cool thing is: Any new commit will generate a new build, so your app will be always updated.另一个很酷的事情是:任何新的提交都会生成一个新的构建,因此您的应用程序将始终更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将多个 Create React App (CRA) 构建添加到 SharePoint 页面? - How do I add more than one Create React App (CRA) build to a SharePoint page? 如何将小型 gatsby 应用程序嵌入到 CRA 应用程序中 - How can I embed small gatsby app into a CRA App 如何在CRA(create-react-app)中对资产进行版本控制? - How to do versioning for assets in a CRA (create-react-app)? 如何通过CRA使用不同的CSS重置样式表? - How do I use different CSS reset stylesheets through CRA? 构建 CRA 应用程序后如何识别 React 组件标签? - How to identify React component tags after build in a CRA app? 本地访问的 React 应用程序不执行 API 调用 [CRA] - Locally accessed react app does not do API call [CRA] 如何将静态 React“应用程序”部署到 Heroku? - How do I deploy a static React "app" to Heroku? 如何有条件地导出(CRA)React App 中的值 - How to conditionally export values in a (CRA) React App 我已经使用 npm 运行构建命令并在 heroku 上部署了应用程序,现在如何编辑我的本地代码,然后将更改再次推送到 heroku? - I have used npm run build command and deployed app on heroku ,now how do I edit my local code and then push app again with the changes to heroku? CRA 应用程序在生产构建后不运行? - CRA app doesn't run after production build?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM