[英]Problems deploying to github pages with vue project
I'm trying to deploy a vue-cli project to github pages, I followed the instructions on this website and on github support. 我正在尝试将vue-cli项目部署到github页面,我按照本网站上的说明和github支持。
delpoy vue-cli to github pages: https://medium.com/@mwolfhoffman/deploying-to-github-pages-with-vue-webpack-cli-5b2ba17f14a0 delpoy vue-cli到github页面: https ://medium.com/@mwolfhoffman/deploying-to-github-pages-with-vue-webpack-cli-5b2ba17f14a0
Configuring github pages https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/ 配置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
在存储库的根目录中有一个/ docs文件夹
not follow the repository naming scheme username.github.io or orgname.github.io
不遵循存储库命名方案username.github.io或orgname.github.io
Here is my repository : https://github.com/leewei05/blog 这是我的存储库: https : //github.com/leewei05/blog
But the result keep giving me 404, still doesn't know what my problem is, please help! 但结果一直给我404,还不知道我的问题是什么,请帮忙!
It turned out I've got the wrong config path, here are the steps to deploy a new vue-cli project to git hub pages. 原来我的配置路径错误,这里是将新的vue-cli项目部署到git hub页面的步骤。
(You got to install npm and vue-cli first) (你必须先安装npm和vue-cli)
modify your build section like this: 像这样修改你的构建部分:
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 }
$ npm run build $ npm run build
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.