From 0930351bc00701d03d8bb8a6c3cead1d075cff24 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Fri, 17 Jul 2026 11:09:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20Vite8=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=90=8E=20dev=20=E7=8E=AF=E5=A2=83=E4=B8=8B=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80=E9=87=8D=E4=BE=9D=E8=B5=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=EF=BC=88tinymce/echarts/vxe-table=20=E7=AD=89=EF=BC=89?= =?UTF-8?q?=E6=97=B6=E7=99=BD=E5=B1=8F=E3=80=81=E5=8A=A0=E8=BD=BD=E6=85=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecgboot-vue3/vite.config.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jeecgboot-vue3/vite.config.ts b/jeecgboot-vue3/vite.config.ts index f7cfc20f0..acd1f2e1b 100644 --- a/jeecgboot-vue3/vite.config.ts +++ b/jeecgboot-vue3/vite.config.ts @@ -86,6 +86,8 @@ export default async ({ command, mode }: ConfigEnv): Promise => { replacement: pathResolve('types') + '/', }, ], + // 避免vue生态多份实例被重复解析/预构建,减少依赖发现和转换的开销 + dedupe: ['vue', 'vue-router', 'pinia', '@vue/shared'], }, server: { // Listening on all local IPs @@ -178,8 +180,12 @@ export default async ({ command, mode }: ConfigEnv): Promise => { '@iconify/iconify', 'ant-design-vue/es/locale/zh_CN', 'ant-design-vue/es/locale/en_US', - // update-begin--author:scott---date:20260427---for: 集成 @jeecg/aiflow(预编译 lib 在 node_modules)时, - // Vite 默认不扫描 node_modules 里已打包的 mjs,导致 ant-design-vue/es/vc-picker/generate/dayjs.js + 'tinymce', + '@tinymce/tinymce-vue', + 'echarts', + 'vxe-table', + 'vxe-pc-ui', + 'vxe-table-plugin-antd', // 引入的 dayjs 插件子路径(UMD/CJS)未被预打包,运行时报 "does not provide an export named 'default'"。 // 显式列出 vc-picker 用到的全部 dayjs 插件,强制 esbuild 预打包成 ESM。 'dayjs/plugin/advancedFormat', @@ -188,8 +194,7 @@ export default async ({ command, mode }: ConfigEnv): Promise => { 'dayjs/plugin/localeData', 'dayjs/plugin/weekOfYear', 'dayjs/plugin/weekYear', - 'dayjs/plugin/quarterOfYear', - // update-end--author:scott---date:20260427---for: 集成 @jeecg/aiflow 时 dayjs 插件 default 导出报错 + 'dayjs/plugin/quarterOfYear' ], exclude: [ //升级vite4后,需要排除online和aiflow依赖