安装插件 npm i @vitejs/plugin-legacy 在vite.config.js 中配置 重新打包就可以正常访问了(注意vite 和 @vitejs/plugin-legacy的版本要匹配,否则会打包失败)