【VUE】Vue项目build后静态资源路径错误问题

使用npm run build后 打开dist文件夹的index.html文件空白

控制台显示很多文件未找到的报错

在vue.config.js中添加:publicPath: './',

如下

const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
	transpileDependencies: true,
	publicPath: './',
});

猜你喜欢

转载自blog.csdn.net/liusuihong919520/article/details/132674507