With the development of the company's internal business, it is necessary to put the ui library and component library that need to be packaged inside the company on the company's private server. For this purpose, we searched from the Internet, selected models, and finally selected verdaccio to build, because we can use it without ourselves To engage in database, you can build it successfully without troublesome configuration.
Verdaccio
Verdaccio is a simple, local private npm registry with zero configuration required. Verdaccio has its own small database out of the box, the ability to proxy other registries (such as npmjs.org), cache downloaded modules
Build the required environment
1. nrm Install nrm to manage npm source, please refer to my other article https://blog.csdn.net/u013994400/article/details/124274349
build process
1. Install verdaccio
npm install -g verdaccio
2. Use nrm to switch local sources
nrm ls
nrm use xxx(本地源)
nrm add 名称 地址 (创建新的源)
nrm del 名称(删除源)
3. Release package
npm login
npm publish
4. If you need to use cnpm
cnpm config set registry xxx(本地源)