From 420fd4f3ff8c4640ca0c9d2fd4a5a7161ca4f582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mac=C2=B7ufutx?= Date: Wed, 11 Jun 2025 17:53:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=2020250611=20=E9=85=8D=E7=BD=AE=20@vitejs?= =?UTF-8?q?/plugin-legacy=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E4=BC=A0=E7=BB=9F=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) 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 }),