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.

build: add ignoreImports option to obfuscation process (#5469)

白熱e5035e41116a
diff --git a/common/shared/vite/utils.ts b/common/shared/vite/utils.ts
index 7fcbffa120..401f246f01 100644
--- a/common/shared/vite/utils.ts
+++ b/common/shared/vite/utils.ts
@@ -54,7 +54,9 @@ export function obfuscator(): Plugin {
for (const file in bundle) {
if (bundle[file].type === 'chunk' && /\.js$/.test(file)) {
const code = bundle[file].code;
- const obfuscationResult = JavaScriptObfuscator.obfuscate(code);
+ const obfuscationResult = JavaScriptObfuscator.obfuscate(code, {
+ ignoreImports: true,
+ });
bundle[file].code = obfuscationResult.getObfuscatedCode();
}
}