这是我的第一个react demo.
若想在gitpage
上看到效果. 先在setting
的GitHub Pages
生成网址https://helloyongwei.github.io/react-helloworld/
.
因为我们的主页是在react-helloworld/build
下. 则要在package.json
中设置下.
其次, 将"homepage" : "http://helloyongwei.github.io/react-helloworld/build"
添加到package.json
. 解释: react-helloworld
是库, build
是库中的目录
然后, 执行npm run build
, 再git push
.
最后在浏览器中打开: https://helloyongwei.github.io/react-helloworld/build/index.html
.