@jump-mp/td-chat
v0.1.23
Published
TDesign Chat Components for Vue 2.7 (standalone)
Readme
td-chat(独立工程)
TDesign Chat 组件库 - Vue 2.7 独立版本,不依赖 monorepo,可直接在本目录完成安装与构建。
环境要求
- Node.js >= 18
- Vue 2.7.16
- tdesign-vue(peer)
安装
npm install
# 若遇 peer vue 版本冲突(如 tdesign-vue 要求 ~2.6),可使用:
npm install --legacy-peer-deps
# 或
pnpm install脚本
| 命令 | 说明 |
|------|------|
| npm run build | 构建产物到 es/、esm/,并打包完整 chat 样式到 es/style/index.css |
| npm run build:full | 使用独立临时环境构建,结束后同样会补全 es/style/index.css |
| npm run build:style | 仅构建完整样式(依赖 style/index.js → tdesign-web-components less) |
| npm run build:type | 仅生成 TypeScript 声明 |
| npm run test | 运行单测 |
| npm run test:dev | 单测 watch 模式 |
| npm run test:coverage | 单测覆盖率 |
构建产物
- es/:ESM(.mjs),供现代打包器使用,
module入口 - esm/:ESM(.js),含
esm/style/index.js引用 tdesign-vue 样式
使用方需安装并引入 tdesign-vue 的样式;组件样式依赖 tdesign-vue 主题变量。
与 monorepo 的差异
- 无 workspace 依赖:不再使用
@tdesign/shared-utils,已用工程内utils/withInstall.ts(Vue 2.7 版)替代。 - 构建:默认
npm run build在本进程执行 Rollup,无需临时目录,避免与根 workspace 的 Vue 版本冲突。 - 样式:从
tdesign-web-components内嵌的 chat less 打包出完整es/style/index.css(与 build:chat 逻辑一致,行数约 430;monorepo 中 build:chat 使用@tdesign/common-style时约 808 行)。
从 monorepo 迁出
本目录由 packages/td-chat 迁出并做上述适配,可直接作为独立仓库使用或复制到其他项目。
