bug更改
This commit is contained in:
parent
6ec994502a
commit
d4882f469c
@ -116,6 +116,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
// 手动分块,将大型库单独打包,减少单个 chunk 的复杂度
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
// 将 univer 相关包统一归为单个 chunk,避免同套模块被打散成多份
|
||||
if (id.includes('@univerjs')) return 'univer';
|
||||
// 将 element-plus, lodash 等大型库单独拆分
|
||||
if (id.includes('element-plus')) return 'element-plus';
|
||||
if (id.includes('ant-design-vue')) return 'ant-design-vue';
|
||||
@ -127,7 +129,23 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 预构建 univer 相关依赖,避免 dev 下同一模块被浏览器按多个 chunk 重复加载
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
'@univerjs/core',
|
||||
'@univerjs/presets',
|
||||
'@univerjs/preset-sheets-core',
|
||||
'@univerjs-pro/exchange-client'
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
// 确保 univer 相关包只解析一份副本,防止多版本副本导致 DI 标识符重复
|
||||
dedupe: [
|
||||
'@univerjs/core',
|
||||
'@univerjs/presets',
|
||||
'@univerjs/preset-sheets-core',
|
||||
'@univerjs-pro/exchange-client'
|
||||
],
|
||||
// Vite路径别名配置
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user