Skip to content

安装与私库

Install

安装与私库

所有 @mbjia/* 包都发布在模板加私有 Verdaccio。接入前先配置 npm 源,再按业务目标安装对应包。

npm 源配置

所有 @mbjia/* 包都发布在模板加私有 Verdaccio。

ini
@mbjia:registry=http://verdaccio.atvideo.cc
registry=https://registry.npmmirror.com/

如果不能访问私库,请检查 hosts:

txt
47.103.41.64 verdaccio.atvideo.cc

推荐安装方式

当前仓库根 README 提到 npmyarn 更稳定,子项目也支持 pnpm workspace。业务项目按已有包管理器选择即可。

bash
npm install @mbjia/ui
npm install @mbjia/components

常见依赖

业务项目通常还需要以下基础依赖:

json
{
  "react": "~17.0.0",
  "react-dom": "~17.0.0",
  "antd": "4.24.16",
  "styled-components": "^6.0.5",
  "less": "^4.1.3"
}

包版本

当前仓库包版本并不完全一致:

当前版本
@mbjia/components3.0.132
@mbjia/ui3.0.125
@mbjia/hooks3.0.120
@mbjia/services3.0.120
@mbjia/manager3.0.121
@mbjia/upload-manager3.0.120
@mbjia/utils3.0.119
@mbjia/site-env3.0.119

安装业务组件时,优先使用与主项目一致的版本组合,避免内部包版本不匹配。

MBJIA Tools 文档