mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-08-17 02:09:03 +00:00
解决 Vite8 升级后 dev 环境下首次打开重依赖路由(tinymce/echarts/vxe-table 等)时白屏、加载慢的问题
This commit is contained in:
parent
df83f4de76
commit
0930351bc0
@ -86,6 +86,8 @@ export default async ({ command, mode }: ConfigEnv): Promise<UserConfig> => {
|
|||||||
replacement: pathResolve('types') + '/',
|
replacement: pathResolve('types') + '/',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// 避免vue生态多份实例被重复解析/预构建,减少依赖发现和转换的开销
|
||||||
|
dedupe: ['vue', 'vue-router', 'pinia', '@vue/shared'],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
// Listening on all local IPs
|
// Listening on all local IPs
|
||||||
@ -178,8 +180,12 @@ export default async ({ command, mode }: ConfigEnv): Promise<UserConfig> => {
|
|||||||
'@iconify/iconify',
|
'@iconify/iconify',
|
||||||
'ant-design-vue/es/locale/zh_CN',
|
'ant-design-vue/es/locale/zh_CN',
|
||||||
'ant-design-vue/es/locale/en_US',
|
'ant-design-vue/es/locale/en_US',
|
||||||
// update-begin--author:scott---date:20260427---for: 集成 @jeecg/aiflow(预编译 lib 在 node_modules)时,
|
'tinymce',
|
||||||
// Vite 默认不扫描 node_modules 里已打包的 mjs,导致 ant-design-vue/es/vc-picker/generate/dayjs.js
|
'@tinymce/tinymce-vue',
|
||||||
|
'echarts',
|
||||||
|
'vxe-table',
|
||||||
|
'vxe-pc-ui',
|
||||||
|
'vxe-table-plugin-antd',
|
||||||
// 引入的 dayjs 插件子路径(UMD/CJS)未被预打包,运行时报 "does not provide an export named 'default'"。
|
// 引入的 dayjs 插件子路径(UMD/CJS)未被预打包,运行时报 "does not provide an export named 'default'"。
|
||||||
// 显式列出 vc-picker 用到的全部 dayjs 插件,强制 esbuild 预打包成 ESM。
|
// 显式列出 vc-picker 用到的全部 dayjs 插件,强制 esbuild 预打包成 ESM。
|
||||||
'dayjs/plugin/advancedFormat',
|
'dayjs/plugin/advancedFormat',
|
||||||
@ -188,8 +194,7 @@ export default async ({ command, mode }: ConfigEnv): Promise<UserConfig> => {
|
|||||||
'dayjs/plugin/localeData',
|
'dayjs/plugin/localeData',
|
||||||
'dayjs/plugin/weekOfYear',
|
'dayjs/plugin/weekOfYear',
|
||||||
'dayjs/plugin/weekYear',
|
'dayjs/plugin/weekYear',
|
||||||
'dayjs/plugin/quarterOfYear',
|
'dayjs/plugin/quarterOfYear'
|
||||||
// update-end--author:scott---date:20260427---for: 集成 @jeecg/aiflow 时 dayjs 插件 default 导出报错
|
|
||||||
],
|
],
|
||||||
exclude: [
|
exclude: [
|
||||||
//升级vite4后,需要排除online和aiflow依赖
|
//升级vite4后,需要排除online和aiflow依赖
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user