vue3 vite 在嵌套多层路由后部署服务器刷新空白
控制台报错
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
查看请求的资源时候,发现路径是从当前页面开始的中间多了当前 '/路径'
解决方法:
就是在vite.config.js 中将base 基础路径改成 '/'
注意官方文档上写的是'./'
不停学习,热爱是源源不断的动力。