gitee项目404问题_vue cli4部署项目到gitee pages ,出现404,找不到资源

问题描述

vue cli4部署项目到gitee pages ,出现404,找不到资源

问题出现的环境背景及自己尝试过哪些方法

百度了一波,按照他们的说法,在vue.config.js配置文件中添加publicPath: './',我配置后,重新打包,依旧没解决,

还有一种是配置publicPath: process.env.NODE_ENV === 'production' ? '/项目仓库名字/' : '/',结果依旧是找不到资源,还有一些其他的,就不贴了,还是报错

相关代码

粘贴代码文本(请勿用截图)

const BASE_URL = process.env.NODE_ENV === 'production' ? "/vue_mimall/" : '/';

module.exports = {

publicPath: BASE_URL,

outputDir: 'dist',

// assetsDir: 'static',

// indexPath: 'index.html',

disableHostCheck: true

},

// publicPath:'/app',

// outputDir:'dist',

// indexPath:'index2.html',

// lintOnSave:false,

productionSourceMap:false,

chainWebpack:(config)=>{

config.plugins.delete('prefetch');

}

}

你期待的结果是什么?实际看到的错误信息又是什么?

点击可以正常访问,实际错误信息是404,

你可能感兴趣的:(gitee项目404问题)