live-h5-audience 2.0.9 → 2.0.11

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/CHANGELOG.md ADDED
@@ -0,0 +1,117 @@
1
+ # 更新日志
2
+
3
+ ## [2.0.11] - 2026-03-10
4
+
5
+ ### 🐛 Bug 修复
6
+
7
+ - 修复 Chunk 加载失败问题(`Loading chunk 0 failed`)
8
+ - 修复 CommonJS 格式 chunk 文件合并问题
9
+ - 修复 merge-chunks.js 脚本变量重复声明错误
10
+
11
+ ### 🔧 技术改进
12
+
13
+ - 更新 merge-chunks.js 脚本,支持自动检测 UMD/CommonJS 格式
14
+ - 优化 chunk 文件清理逻辑
15
+ - 改进构建后的文件输出结构
16
+ - 添加测试页面 `test-package.html` 用于验证构建结果
17
+
18
+ ### 📝 文档更新
19
+
20
+ - 更新 NPM_USAGE.md,添加构建和发布流程说明
21
+ - 完善 example-usage 示例项目
22
+
23
+ ---
24
+
25
+ ## [2.0.10] - 2026-03-10
26
+
27
+ ### 🎉 重大更新 - 外部化依赖重构
28
+
29
+ **变更说明**:本次更新重构了 npm 包的依赖管理方式,采用外部化依赖(externals)配置,显著减小包体积并避免版本冲突。
30
+
31
+ ### ✨ 新增
32
+
33
+ - ✅ 采用 `peerDependencies` 声明核心依赖
34
+ - ✅ 在 `vue.config.js` 中配置 `externals` 外部化核心依赖
35
+ - ✅ 自动检测重复安装插件,避免重复注册
36
+ - ✅ 创建详细的使用文档 `NPM_USAGE.md`
37
+ - ✅ 提供完整的使用示例项目 `example-usage/`
38
+
39
+ ### 📝 优化
40
+
41
+ - 🔄 将 `vue`、`vue-router`、`vuex`、`vant`、`element-ui` 移至 `peerDependencies`
42
+ - 🔄 更新 `src/package-entry.js` 的使用说明和注释
43
+ - 🔄 优化插件安装逻辑,自动检测已安装的依赖
44
+ - 🔄 更新 `README.md`,添加重要更新说明
45
+
46
+ ### ⚠️ 破坏性变更
47
+
48
+ 使用前必须安装以下依赖:
49
+
50
+ ```bash
51
+ npm install vue@^2.6.0 vue-router@^3.0.0 vuex@^3.0.0 vant@^2.5.0 element-ui@^2.7.0
52
+ ```
53
+
54
+ ### 📚 文档
55
+
56
+ - 新增 `NPM_USAGE.md` - 详细的使用文档
57
+ - 新增 `example-usage/` - 快速入门示例项目
58
+ - 更新 `README.md` - 添加重要更新说明和使用指南
59
+
60
+ ### 🔧 技术细节
61
+
62
+ **依赖变更**:
63
+ - `vue`: `dependencies` → `peerDependencies`
64
+ - `vue-router`: `dependencies` → `peerDependencies`
65
+ - `vuex`: `dependencies` → `peerDependencies`
66
+ - `vant`: `dependencies` → `peerDependencies`
67
+ - `element-ui`: `dependencies` → `peerDependencies`
68
+
69
+ **配置变更**:
70
+ ```javascript
71
+ // vue.config.js
72
+ config.externals({
73
+ 'vue': { commonjs: 'vue', commonjs2: 'vue', amd: 'vue', root: 'Vue' },
74
+ 'vue-router': { commonjs: 'vue-router', commonjs2: 'vue-router', amd: 'vue-router', root: 'VueRouter' },
75
+ 'vuex': { commonjs: 'vuex', commonjs2: 'vuex', amd: 'vuex', root: 'Vuex' },
76
+ 'vant': { commonjs: 'vant', commonjs2: 'vant', amd: 'vant', root: 'vant' },
77
+ 'element-ui': { commonjs: 'element-ui', commonjs2: 'element-ui', amd: 'element-ui', root: 'ELEMENT' }
78
+ })
79
+ ```
80
+
81
+ ### 🚀 使用示例
82
+
83
+ ```javascript
84
+ import Vue from 'vue'
85
+ import LiveH5 from 'live-h5-audience'
86
+ import 'live-h5-audience/dist/live-h5-audience.css'
87
+
88
+ // 确保先安装依赖
89
+ // npm install vue@^2.6.0 vue-router@^3.0.0 vuex@^3.0.0 vant@^2.5.0 element-ui@^2.7.0
90
+
91
+ Vue.use(LiveH5, {
92
+ containerId: '#live-h5-app',
93
+ apiBaseUrl: 'https://api.example.com',
94
+ defaultRoute: '/roomList'
95
+ })
96
+ ```
97
+
98
+ ### 🐛 修复
99
+
100
+ - 修复了因依赖版本冲突导致的问题
101
+ - 修复了重复安装插件导致的警告
102
+
103
+ ### 📖 迁移指南
104
+
105
+ 如果你已经使用旧版本的包,需要做以下调整:
106
+
107
+ 1. 安装必需的 peerDependencies
108
+ 2. 确保样式正确引入
109
+ 3. 检查容器元素是否存在
110
+
111
+ 详细迁移指南请参考 [NPM_USAGE.md](./NPM_USAGE.md)
112
+
113
+ ---
114
+
115
+ ## [2.0.9] 及更早版本
116
+
117
+ 详细变更记录请查看 Git 提交历史。
package/README.md CHANGED
@@ -179,23 +179,34 @@ this.$liveH5Store
179
179
 
180
180
  ## 依赖说明
181
181
 
182
- ### 宿主项目需要提供
183
-
184
- 以下依赖由宿主项目提供(通过 externals 配置):
185
-
186
- - `vue` >= 2.6.x
187
- - `vue-router` >= 3.0.x
188
- - `vuex` >= 3.0.x
189
-
190
- ### 包内包含的依赖
191
-
192
- 以下依赖已打包在 npm 包中:
193
-
194
- - `element-ui` >= 2.7.x
195
- - `vant` >= 2.5.x
196
- - `axios` >= 0.19.x
197
- - `vue-bus` >= 1.2.x
198
- - 以及其他所有功能依赖
182
+ ### 必需依赖(peerDependencies)
183
+
184
+ 以下依赖由**使用方**提供(不在包内打包):
185
+
186
+ | 依赖 | 版本要求 | 说明 |
187
+ |------|---------|------|
188
+ | `vue` | ^2.6.0 | Vue 核心框架 |
189
+ | `vue-router` | ^3.0.0 | 路由管理 |
190
+ | `vuex` | ^3.0.0 | 状态管理 |
191
+ | `vant` | ^2.5.0 | 移动端组件库 |
192
+ | `element-ui` | ^2.7.0 | 桌面端组件库 |
193
+
194
+ ### 包内依赖(dependencies)
195
+
196
+ 以下依赖已**打包**在 npm 包中:
197
+
198
+ - `axios` - HTTP 请求
199
+ - `vue-bus` - 事件总线
200
+ - `flv.js` - FLV 播放器
201
+ - `video.js` - 视频播放器
202
+ - `xgplayer` - 西瓜播放器
203
+ - `tim-js-sdk` - 腾讯 IM SDK
204
+ - 以及其他功能依赖
205
+
206
+ **为什么不将 vant 和 element-ui 打包进包内?**
207
+ - 避免版本冲突
208
+ - 减小包体积
209
+ - 允许使用方灵活选择版本
199
210
 
200
211
  ## 构建和发布
201
212