git - 使用vue项目部署到github页面的问题

标签 git github vue.js github-pages

我正在尝试将 vue-cli 项目部署到 github 页面,我按照本网站和 github 支持上的说明进行操作。

delpoy vue-cli 到 github 页面: https://medium.com/@mwolfhoffman/deploying-to-github-pages-with-vue-webpack-cli-5b2ba17f14a0

配置github页面 https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/

Setting -> source -> master /docs

have a /docs folder in the root of the repository

not follow the repository naming scheme username.github.io or orgname.github.io

这是我的存储库:https://github.com/leewei05/blog

但是结果一直给我404,还是不知道我的问题是什么,求助!

最佳答案

原来我的配置路径错误,这里是将新的 vue-cli 项目部署到 git hub 页面的步骤。

(你得先安装npm和vue-cli)

  1. $ vue init webpack [项目名称]
  2. $ cd [项目名称]
  3. $ npm install
  4. 转到您的 config/index.js 文件
  5. 像这样修改构建部分:
build: {
    index: path.resolve(__dirname, '../docs/index.html'),
    assetsRoot: path.resolve(__dirname, '../docs'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '',
    productionSourceMap: true,
    devtool: '#source-map',
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    bundleAnalyzerReport: process.env.npm_config_report
  }
  1. $ npm run build
  2. 将其推送到您的 github 存储库
  3. 转到存储库中的设置
  4. 找到您的 GitHub 页面部分并将来源更改为 '大师' -> '大师/文档'
  5. 你的页面应该在 https://[userName].github.io/[repositoryName]/#/
  6. 祝你好运!

关于git - 使用vue项目部署到github页面的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47615863/

相关文章:

javascript - vue-cli-service serve 的依赖问题

javascript - Vue v 绑定(bind) :class not working immediately when changing the binded object's value

Git 产生 "BUG: There are unmerged index entries"

git - 从非原始存储库 merge

git - 使用 NetBeans pull 时如何获取修改后的文件?

git - 有没有办法共享一个 git Remote ?

Android - 保护我的应用程序免受外部 GitHub 库的更改/删除?

windows - 为什么是git@github.com : Permission denied (publickey) in windows?

javascript - vue js调用不同页面的方法函数

git - git diff发布标记和commitID