部署React应用后,Github页面仍显示README
我有一个create-react-app
项目( https://github.com/khpeek/beomaps /tree/master ),我想使用 gh-部署到Github页面页.遵循本教程后, https://medium.com /@ serverlessguru/deploy-reactjs-app-with-s3-static-hosting-f640cb49d7e6 ,我在package.json
中添加了以下内容:
I have a create-react-app
project (https://github.com/khpeek/beomaps/tree/master) which I'd like to deploy to Github pages using gh-pages. Following this tutorial, https://medium.com/@serverlessguru/deploy-reactjs-app-with-s3-static-hosting-f640cb49d7e6, I've added the following to my package.json
:
但是,如果我运行npm run deploy
,它将被发布,
However, if I run npm run deploy
, it is published,
但Github页面 https://khpeek.github.io/beomaps/,仍显示基于README.md
的默认内容.我可能需要更改部署目录吗?
but the Github page, https://khpeek.github.io/beomaps/, still shows default content based on the README.md
. Do I perhaps need to change the deploy directory?
在存储库的选项"页面中,我必须选择gh-pages
分支而不是master
分支:
In the Options page of the repository, I had to select the gh-pages
branch instead of the master
branch:
(尽管我不确定这是否很重要,但我也重新安装了gh-pages
作为正常的依赖关系,而不是开发依赖关系(即npm install gh-pages --save
而不是npm install gh-pages --save-dev
).
(I also re-installed gh-pages
as a normal dependency, not a development one (i.e. npm install gh-pages --save
instead of npm install gh-pages --save-dev
), though I'm not sure whether this was important).
现在该页面在Github页面上可见:
Now the page is visible on Github pages: