业务组件库,主要功能:
- 组件库源码,包含多个业务组件
- 使用手册、开发手册
- 示例与Demo
- 组件库构建、发布:npm发布、git发布
webpack
|__components 业务组件库
|__css 组件样式
|__lib 组件JS源码
|__dist 编译目录
|__doc vue-press文档
|__public 静态资源
|___package.json 依赖管理
|___vue.config.js 开发和构建的常用配置
|___gulpfile.js 使用gulp构建css
|___webpack.component.js 构建js
|___.eslintignore eslint检查工具忽略文件配置
|___.eslintrc.js eslint检查工具配置
|___.gitignore git版本控制忽略管理的文件配置
- npm install
- docs:dev
- 访问url,查看用户手册、开发手册、示例
后编译模式
携带*.vue、*.scss文件发布,使用者需要直接引用,然后通过脚手架编译后使用。
预编译模式
提前构建dist目录,并且提供各种版本的文件
使用者可以通过webpack依赖,进行使用。
可以通过以下方式格式化用于npm软件包的Git URL:
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
代码示例
"dependencies": {
"my-components": "git+ssh://git@github.com:mvphjx/MyComponent.git"
}
发布到npm。通过版本号引用,install后使用。
使用手册&开发手册
|__doc vue-press文档
|__.vuepress vue-press文档
|__components 组件
|__config.js vue-press通用配合
|__enhanceApp.js vue-press项目扩展
|__public 静态资源
|__conponentDocs md格式文档