Refused to apply style from 'http://localhost:1291/css/app.cb7fc8a9.css' because its MIME type ('...

vue項(xiàng)目 打包錯(cuò)誤
Refused to apply style from 'http://localhost:1291/css/app.cb7fc8a9.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

image.png

解決方案參考
配置相對(duì)路徑


module.exports = {
    // 基本路徑
    publicPath:"./",  // 可以設(shè)置成相對(duì)路徑,這樣所有的資源都會(huì)被鏈接為相對(duì)路徑,打出來的包可以被部署在任意路徑
    outputDir:"dist",  //打包時(shí)生成的生產(chǎn)環(huán)境構(gòu)建文件的目錄
    assetsDir: 'public',  // 放置生成的靜態(tài)資源 (js、css、img、fonts) 的 (相對(duì)于 outputDir 的) 目錄
    /*devServer: {
        proxy: 'http://localhost:8080'
    }*/
}

https://blog.csdn.net/yys190418/article/details/107217457/?utm_medium=distribute.pc_relevant.none-task-blog-title-2&spm=1001.2101.3001.4242

image.png

總結(jié):
感謝 打包路徑是絕對(duì)路徑,改了之后只有tabbar顯示,后來百度了下說讓路由改成hash模式,成了 ,不知道為啥history 不行


image.png

https://www.cnblogs.com/mmzuo-798/p/10871750.html

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容