vue项目打包后运行index.html,会报错"because its MIME type...

打包后运行index.html,会报错"because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

1.找到config文件夹下的index.js文件,将build下的assetsPublicPath:"/"设置成assetsPublicPath:"./",

2.找到build文件夹 -> utils.js,在里面将加入一句publicPath: '../../'

posted @ 2022-10-06 07:06  Mahmud(مەھمۇد)  阅读(1911)  评论(0编辑  收藏  举报