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(build): build add keepNames (#2854)

#FF00008ca83795b077
diff --git a/common/shared/vite/index.js b/common/shared/vite/index.js
index 305617cc87..8ac383b164 100644
--- a/common/shared/vite/index.js
+++ b/common/shared/vite/index.js
@@ -46,13 +46,17 @@ function createViteConfig(overrideConfig, /** @type {IOptions} */ options) {
const dirname = process.cwd();
+ const esbuild = {};
+
+ // don't minify identifiers for univerjs packages
+ if (pkg.name.startsWith('@univerjs/')) {
+ esbuild.minifyIdentifiers = false;
+ esbuild.keepNames = true;
+ }
+
/** @type {import('vite').UserConfig} */
const originalConfig = {
- // optimizeDeps: {
- // esbuildOptions: {
- // keepNames: true,
- // },
- // },
+ esbuild,
build: {
target: 'chrome70',
outDir: 'lib',