Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

chore(shared): add auto-externalization for lodash and fix version for lodash/debounce

白熱b53901279c60
diff --git a/common/shared/vite/auto-externalize-dependency-plugin.js b/common/shared/vite/auto-externalize-dependency-plugin.js
index 82e5680a72..5a11ff6cdf 100644
--- a/common/shared/vite/auto-externalize-dependency-plugin.js
+++ b/common/shared/vite/auto-externalize-dependency-plugin.js
@@ -23,10 +23,15 @@ exports.autoExternalizeDependency = function autoExternalizeDependency() {
name: 'clsx',
version: '>=2.0.0',
},
+ lodash: {
+ global: 'lodash',
+ name: 'lodash',
+ version: '>=4.0.0',
+ },
'lodash/debounce': {
global: 'lodash.debounce',
name: 'lodash',
- version: '>=4.0.0',
+ version: 'lodash',
},
'monaco-editor': {
global: 'monaco',
@@ -113,6 +118,10 @@ exports.autoExternalizeDependency = function autoExternalizeDependency() {
if (version) {
if (version !== name) {
peerDependencies[ext] = version;
+ } else {
+ if (!peerDependencies[version]) {
+ peerDependencies[name] = externalMap[version].version;
+ }
}
} else {
peerDependencies[ext] = 'workspace:*';