feat: 20250611 配置 @vitejs/plugin-legacy,自动兼容传统浏览器
This commit is contained in:
parent
8e283b7544
commit
420fd4f3ff
@ -5,9 +5,16 @@ import path from 'path' // 引入 path 模块
|
|||||||
import viteImagemin from 'vite-plugin-imagemin' // 新插件
|
import viteImagemin from 'vite-plugin-imagemin' // 新插件
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
|
|
||||||
|
import legacy from '@vitejs/plugin-legacy'
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
|
legacy({
|
||||||
|
targets: ['ie >= 11'],
|
||||||
|
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
||||||
|
modernPolyfills: true // 启用现代浏览器的 polyfill
|
||||||
|
}),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
imports: ['vue', 'vue-router'] // 自动导入 Vue、Vue Router API
|
imports: ['vue', 'vue-router'] // 自动导入 Vue、Vue Router API
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user