基于Rollup.js 的 React 组件库样板

该项目提供了一个样板,用于创建 React 组件库,并通过 Rollup.js 捆绑为 ES6 模块。

开始使用

可以使用以下两种方式开始使用此仓库:

  • 使用 Git:
git clone git@github.com:KaiHotz/react-rollup-boilerplate.git
cd react-rollup-boilerplate
npm install
  • 下载 .zip 文件:

提取 .zip 文件的内容,然后打开终端并执行以下命令:

npm install

开发

要开始开发,请运行以下命令:

npm run dev

此命令将构建您的库,运行观察程序以及 Styleguide。要手动打开 Styleguide,请在浏览器中导航至 http://localhost:6060

src/lib/components 文件夹中开发组件,并更新 src/lib/index.js 文件。提供 YourComponent.examples.md 文件,以在 Styleguide 中显示组件。

建议

为了更轻松地开发,已包含以下内容:

  • Babel 插件
  • 造型组件
zip
react-rollup-boilerplate-master.zip 预估大小:24个文件
folder
react-rollup-boilerplate-master 文件夹
file
styleguide.config.js 2KB
file
rollup.config.js 2KB
folder
config 文件夹
file
cssTransform.js 299B
file
fileTransform.js 740B
file
setupTests.js 389B
file
webpack.config.js 729B
file
package.json 6KB
file
prettier.config.js 353B
file
LICENSE 1KB
file
package-lock.json 954KB
folder
src 文件夹
folder
lib 文件夹
folder
components 文件夹
folder
Button 文件夹
file
Button.tsx 418B
file
styles.css 712B
file
Button.test.js 835B
file
index.ts 81B
file
Button.examples.md 123B
file
index.ts 103B
folder
styleguide 文件夹
file
index.html 362B
file
.npmignore 315B
file
.eslintrc.js 6KB
file
tsconfig.json 1KB
file
.stylelintrc.js 2KB
file
.gitignore 299B
file
README.md 5KB
file
.eslintignore 65B
zip 文件大小:220.12KB