github-page部署vue/react静态页面在线预览demo

  1. git checkout -b "gh-pages"
  2. yarn add gh-pages
  3. 修改package.json 增加 "deploy" : "gh-pages -d build" bulid是打包后生成的路径
  4. 修改package.json 增加 "homepage": "https://xxxx.github.io/项目名称"
  5. yarn run build
  6. yarn run deploy
  7. github setting 选择 gh-pages 分支

vue-cli需要在config/index.js 将assetsublicPath: '/' 改为 './'

评论

暂无评论