🐳 预览
⚡ 安装
使用 npm
npm install chocolate-ui --save
使用 yarn
yarn add chocolate-ui
📖 使用
1 .全部引入
// 加载样式
import 'chocolate-ui/dist/styles/index.css'
// 引入组件
import { Button } from 'chocolate-ui'
2 .按需加载
import Button from 'chocolate-ui/dist/components/button';
import 'chocolate-ui/dist/components/button/style';
3 .使用 babel-plugin-import
// .babelrc.js
module.exports = {
plugins: [
[
'babel-plugin-import',
{
libraryName: 'chocolate-ui',
libraryDirectory: 'dist/components',
style: true // 导入 CSS 源文件,可以在编译期间进行优化
}
],
]
}
😊 谁在使用
- 我自己的 hooks 集合 -> chocolate-hooks
✨ 技术栈
-
😁 全部组件由TypeScript with React Hooks
编写 -
🍑 使用react-testing-library
完成单元测试 -
🦌 使用Storybook
本地调试和生成文档页面 -
⚙️ 组件库打包使用Webpack
和Gulp
-
🥦 CI/CD:使用Chromatic
+GitActions
持续集成和部署