本地开发npm包方法以及推送
-
- 1、生成本次的包名:npm init vite@latest app_input --template vue
- 2、cd app_input
- 3、npm install (根据开发需要安装不同的包)
- 4、npm run dev
- 5、进行组件开发
- 6、切换上传包的私库地址: npm config set registry https://repository.genostack.com/repository/npmhost/
- 7、npm login (之前登录过无需登录)
- 8、npm publish --access public (将包推送到私库中,其他项目npm i app即可)
-
前端表单组件已经发布(app_input)
使用方法:
1、本地npm包切换源
npm config set registry https://repository.genostack.com/repository/npm-group/
2、app_input依赖包(如果项目安装则可以忽视)
@element-plus/icons-vue
axios
element-plus
3、安装app_input
npm install app_input
4、使用:查看包的的readme文件