繁体   English   中英

如何使用 github gh-pages 部署反应应用程序

[英]how to deploy react app with github gh-pages

我在没有使用样板 create-react-app 的情况下创建了反应应用程序。 我想用 git 集线器来部署它。 我可以部署它吗? 如果是,任何人都可以建议步骤吗?

Assuming you have gh-pages package installed and you know how to deploy a index.html for example, add this in your package.json scripts:

scripts: {
    ...,
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
}

然后运行npm run deploy

如果您遇到困难,请查看这篇有关它的深入文章,或对此答案发表评论

https://dev.to/yuribenjamin/how-to-deploy-react-app-in-github-pages-2a1f

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM