vue3.2+ vite3.1项目,iis部署后访问,当停留在某个一段时间后在不全局刷新的情况下打开一个新的页面浏览器控制台报错: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.

问题:
项目打包使用gzip进行压缩打包,Gzip 是在 Unix 和类 Unix 系统上使用的一种文件格式和软件应用程序,用于在 HTTP 内容提供给客户端之前对其进行压缩。从而 缩短页面加载时间、减少带宽消耗并减少 SSL 开销。
解决:
Nginx环境安装并启用gzip模块
IIS 启用gzip
Tomcat 启用gzip