钱多多记账 React版 项目部署总结

137 阅读1分钟

提交到 GitHub

项目完成后,打包

npm run build 

然后提示可以可以本地试运行

npm install -g serve
serve -s build

页面成功出现。

为在 GitHub Pages 正常显示,需配置路径

package.json 中加入

"homepage": "http://Orange-ice.github.io/morney-react-website"

deploy.sh 文件

一个脚本文件,可快速完成打包部署命令

#!/usr/bin/env bash

npm run build &&
cd build &&
git init &&
git add . &&
git commit -m 'deploy' &&
git remote add origin git@github.com:Orange-ice/morney-react-website.git &&
git push -u origin master -f
cd -