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): add WS_NO_BUFFER_UTIL environment variable to avoid optional dependency issue (#6370)

白熱fca07d411c6b
diff --git a/common/shared/vite/index.ts b/common/shared/vite/index.ts
index 4369ac1108..53e7efdba0 100644
--- a/common/shared/vite/index.ts
+++ b/common/shared/vite/index.ts
@@ -214,6 +214,8 @@ export async function build(options?: IBuildOptions) {
define: {
'process.env.NODE_ENV': JSON.stringify('production'),
'process.env.BUILD_TIMESTAMP': JSON.stringify(Math.floor(Date.now() / 1000)),
+ // for ws package to avoid optional dependency issue
+ 'process.env.WS_NO_BUFFER_UTIL': JSON.stringify(true),
},
plugins: [
trimClassNamePlugin(),