collabdocchat 2.5.11 → 2.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>CollabDocChat - 协作文档聊天平台</title>
7
7
  <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
8
8
  <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
9
- <script type="module" crossorigin src="/assets/index-Vc_T-zsG.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-1ylqJADA.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-D8ZqeoaM.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabdocchat",
3
- "version": "2.5.11",
3
+ "version": "2.5.13",
4
4
  "description": "开源的实时协作文档聊天平台 - 集成任务管理、多人文档编辑、智能点名功能",
5
5
  "main": "./server/index.js",
6
6
  "type": "module",
@@ -89,9 +89,13 @@
89
89
  "yjs": "^13.6.10"
90
90
  },
91
91
  "devDependencies": {
92
+ "buffer": "^6.0.3",
92
93
  "concurrently": "^8.2.2",
94
+ "crypto-browserify": "^3.12.0",
93
95
  "nodemon": "^3.0.2",
94
96
  "open": "^11.0.0",
97
+ "process": "^0.11.10",
98
+ "stream-browserify": "^3.0.0",
95
99
  "vite": "^5.0.8"
96
100
  }
97
101
  }
@@ -145,3 +145,6 @@ console.log('\n');
145
145
 
146
146
 
147
147
 
148
+
149
+
150
+
@@ -141,3 +141,6 @@ console.log(' 或: npm start\n');
141
141
 
142
142
 
143
143
 
144
+
145
+
146
+
@@ -101,3 +101,6 @@ setTimeout(() => {
101
101
 
102
102
 
103
103
 
104
+
105
+
106
+
package/src/main.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Polyfills for browser compatibility
2
+ import './polyfills.js';
3
+
1
4
  import './styles/main.css';
2
5
  import { AuthService } from './services/auth.js';
3
6
  import { WebSocketService } from './services/websocket.js';
@@ -0,0 +1,11 @@
1
+ // Polyfills for browser compatibility
2
+ import { Buffer } from 'buffer';
3
+ import process from 'process';
4
+
5
+ // 注入全局变量
6
+ window.Buffer = Buffer;
7
+ window.process = process;
8
+ window.global = window;
9
+
10
+ export { Buffer, process };
11
+
package/vite.config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { defineConfig } from 'vite';
2
+ import { Buffer } from 'buffer';
2
3
 
3
4
  export default defineConfig({
4
5
  server: {
@@ -14,7 +15,35 @@ export default defineConfig({
14
15
  build: {
15
16
  rollupOptions: {
16
17
  // 移除 external 配置,让 Vite 打包所有依赖
18
+ },
19
+ commonjsOptions: {
20
+ transformMixedEsModules: true
17
21
  }
22
+ },
23
+ define: {
24
+ // 修复 crypto 模块在构建时的问题
25
+ 'process.env': {},
26
+ 'global': 'globalThis',
27
+ 'Buffer': ['buffer', 'Buffer']
28
+ },
29
+ resolve: {
30
+ alias: {
31
+ // 确保使用浏览器兼容的模块
32
+ 'crypto': 'crypto-browserify',
33
+ 'stream': 'stream-browserify',
34
+ 'buffer': 'buffer',
35
+ 'process': 'process/browser'
36
+ }
37
+ },
38
+ optimizeDeps: {
39
+ esbuildOptions: {
40
+ // Node.js 全局变量注入
41
+ define: {
42
+ global: 'globalThis'
43
+ },
44
+ plugins: []
45
+ },
46
+ include: ['buffer', 'process']
18
47
  }
19
48
  });
20
49