build: 添加 @vitejs/plugin-legacy 插件,支持传统浏览器,支持直接以文件方式打开

This commit is contained in:
2024-08-31 19:12:27 +08:00
parent e4673377fd
commit 18f3b97ab8

View File

@@ -1,6 +1,7 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
@@ -10,8 +11,16 @@ function getPath(url = '') {
export default defineConfig({
base: './',
build: {
assetsInlineLimit: 0,
},
envPrefix: 'V_ENV_',
plugins: [
legacy({
renderLegacyChunks: true,
renderModernChunks: true,
targets: ['defaults', 'not IE 11'],
}),
vue(),
vueJsx(),
],