diff --git a/vite.config.ts b/vite.config.ts index 45b0de6..252c7ec 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,9 +5,16 @@ import path from 'path' // 引入 path 模块 import viteImagemin from 'vite-plugin-imagemin' // 新插件 import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' + +import legacy from '@vitejs/plugin-legacy' export default defineConfig({ plugins: [ vue(), + legacy({ + targets: ['ie >= 11'], + additionalLegacyPolyfills: ['regenerator-runtime/runtime'], + modernPolyfills: true // 启用现代浏览器的 polyfill + }), AutoImport({ imports: ['vue', 'vue-router'] // 自动导入 Vue、Vue Router API }),