我正在尝试将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/
设置->源->主/ docs
在存储库的根目录中有一个/ docs文件夹
不遵循存储库命名方案username.github.io或orgname.github.io
这是我的存储库:https : //github.com/leewei05/blog
但是结果一直给我404,仍然不知道我的问题是什么,请帮忙!
原来我的配置路径错误,这是将新的vue-cli项目部署到git hub页面的步骤。
(您必须先安装npm和vue-cli)
像这样修改您的构建部分:
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运行构建
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句