1.0.0 • Published 2 years ago
vite-react-library-template v1.0.0
Vite React Library Template
Dead simple Vite template for painless React UI library development.
- Unopinionated: no default styling, ESLint, pre-commit hooks — bring your own stuff if you need it.
- Type definitions are extracted using vite-plugin-dts.
- Bundles to ES and UMD modules, generates sourcemaps.
- Uses Storybook for docs which are easily deployed as GitHub pages.
Getting started
This is a custom template for Vite, so instead of npm create vite do this:
npx degit mlshv/vite-react-library-template#main your-project-name
cd your-project-name
npm install
npm startPublishing the library
- Build the package:
npm run build - Open
package.json, update package name, description, author, repository, remove"private": true. - Run
npm publish
Publishing Storybook to GitHub pages
Storybook static is built to docs directory which is under git. To publish it to GitHub Pages do this:
- Publish this repo to GitHub.
- Run
npm run build-storybook, commitdocsfolder and push. - Create a separate GitHub Pages repo if you haven't yet.
- Set up GitHub pages for this project to build from
docsfolder frommainbranch.- To do this go to this repo's settings and open
Pagessection (menu on the left side). SelectSource->Deploy from a branch, selectBranch->mainand/docsfolder.
- To do this go to this repo's settings and open
Contributing
Feel free to open an issue or create a PR if you'd like to contribute 🙌
License
The project is available as open source under the terms of the MIT License.
1.0.0
2 years ago