我可以在常规主机上部署我的 ReactJS 应用程序吗? [英] Can I deploy my ReactJS app on a regular host?

查看:39
本文介绍了我可以在常规主机上部署我的 ReactJS 应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 React 的新手,我看过很多指南,人们教您如何在诸如数字海洋、heroku、GitHub 页面、aws 等服务上部署 React 应用程序.但我想知道我是否可以部署我的 React 应用程序(create-react-app),它只包含主机服务(如 000webhost 或 Ipage)中的前端?因为一个人要我设计一个网站,他说他已经在lpage有域名和主机服务了.

I'm new to React, and I've seen many guides where people teach you how to deploy your react app on services like digital ocean, heroku, GitHub Pages, aws. But I'm wondering if I can deploy my React app (create-react-app) which consists of only front end in a host service like 000webhost or Ipage? Because a person wants me to design a website, and he says that he already has a domain name and a host service in lpage.

提前致谢

推荐答案

我使用 webpack 来捆绑我的 React 应用程序.所以最后反应应用程序将是:

I use webpack to bundle my react app. So at the end react app will be:

  • 一个包(如果您使用动态包加载,则很少更多 - 可能不会),这只是一个 javascript 文件
  • 在正文末尾包含此文件的 index.html
  • 以及原则上可以在一个文件(或包含多个文件的单独文件夹)中设置并包含在 index.html 顶部的 .css

关于 .css 有几种更好的方法来包含,但您可能可以从上面提到的简单设置开始.

Regarding .css there are several better ways how to include, but you can likely start with simple setup as mentioned above.

因此,您只需将这 3 样东西放在您的服务器上,您的应用就可以在 index.html 上找到.

So you just put these 3 things on your server, and your app is available at index.html.

附言不知道什么是Ipage,也没有用过create-react-app.

P.S. Don't know what is Ipage, and haven't worked with create-react-app.

这篇关于我可以在常规主机上部署我的 ReactJS 应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆