更新时间:2021-10-14 21:30:48
您的 webpack 配置格式不正确.所以你的 devServer 返回的是后备 html 文件而不是包.
Your webpack config is malformed. So your devServer is returning the fallback html file instead of the bundle.
因此为什么脚本使用 ('text/html') MIME 类型.
Hence why the script is served with the ('text/html') MIME type.
devServer: {
historyApiFallback:{
index:'/dist/index.html'
},
}
你的意思可能是这样的:
You probably meant something like this:
devServer: {
historyApiFallback: true
}