1 Star 0 Fork 0

leopen / react-lib-boilerplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

react-lib-boilerplate

介绍

构建 react npm package 的脚手架模板,基于 vite

使用

  • 使用项目模板(推荐)

    git clone https://gitee.com/leopen/react-lib-boilerplate.git
    cd react-lib-boilerplate
    npm install
    
    # run examples
    npm run dev
    
    # build lib
    npm run build
    
    # run test
    npm run test
  • 手动逐步安装(后续更新可能导致此安装过程缺少部分组件)

    # Init by vite react-ts template
    npm init vite@latest react-lib-boilerplate -- --template react-ts
    cd react-lib-boilerplate
    npm install
    
    # Add test framework
    
    ## step 1: install jest for testing and a jest transformer: ts-jest
    npm install --save-dev jest @types/jest ts-jest
    
    ## step 2:install some packages for testing react
    npm install --save-dev @testing-library/jest-dom @testing-library/react
    
    ## step 3:install a package for mocking css
    npm install --save-dev identity-obj-proxy
    
    ## step 4:config ts, ts-jest, see jest.config.js for detail
    npx ts-jest config:init
    
    ## step 5:add test command, see package.json for detail
    
    # Add eslint and prettier for code style checking and formatting
    
    ## step 1: install eslint
    npm install --save-dev eslint
    
    ## step 2: init eslint
    npx eslint --init
    
    ## step 3: support typescript (can be skipped if you selected typescript in step 2)
    npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
    
    ## step 4: support react (can be skipped if you selected react in step 2)
    npm install --save-dev eslint-plugin-react
    
    ## step 5: config eslint, include .eslintrc.json and .eslintignore, see files for detail
    
    ## step 6: install prettier
    npm install --save-dev prettier eslint-config-prettier
    
    ## step 7: config prettier, include .prettierrc and .prettierignore, see files for detail
    
    ## step 8: add prettier to eslint extends, see .eslintrc.json for detail
    
    # Config for vite build lib, include vite.config.ts and package.json. see https://cn.vitejs.dev/guide/build.html#library-mode
    
    # More, like install husky, do anything you like

说明

暂无

FAQ

MIT License Copyright (c) 2021 leopen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

构建 react npm package 的脚手架模板。使用了 vite、jest 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/leopen/react-lib-boilerplate.git
git@gitee.com:leopen/react-lib-boilerplate.git
leopen
react-lib-boilerplate
react-lib-boilerplate
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891