vue cli项目打包后index.html页面空白怎么办?

vue项目打包成功后生成dist文件,在dist文件里的index.html页面打开是空白的,并且控制台报错:
在这里插入图片描述
报错的原因在于index.html页面里引入文件的路径有问题
我们可以在官网上找到vue cli的配置参考
在这里插入图片描述

解决方案:在vue根目录下创建vue.config.js文件在里面

module.exports = {
    publicPath: './',
};

猜你喜欢

转载自blog.csdn.net/assgrsryiy12/article/details/108441264