Skip to content

A template for creating packages using the React framework and the Vite build tool, and written in TypeScript.

Notifications You must be signed in to change notification settings

andrewdyer/react-vite-package-template

Repository files navigation

React + Vite Package Template

React + Vite Package Template

A template for creating packages using the React framework and the Vite build tool, and written in TypeScript.

⚖️ License

Licensed under the MIT license and is free for private or commercial projects.

✨ Introduction

This template is designed to provide a solid foundation to help you hit the ground running and save valuable time when starting a new React package. With all the necessary tools and configurations included, you can focus on building your package without worrying about the initial setup.

📋 Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js: Version 22.x (as specified in .nvmrc) is required.
  • npm: Dependency management tool, version 9.x or higher.
  • yalc (optional): For local package development and testing.

🛠️ Features

This template includes the following tools and configurations:

  • Vite for fast builds and modern bundling with multiple output formats (ESM, CJS, and UMD), using @vitejs/plugin-react-swc for React support.
  • TypeScript for static type checking, with dedicated configurations for builds and development.
  • Vitest for unit testing, along with React Testing Library, Vitest UI, and coverage reports.
  • Storybook for building and testing UI components in isolation.
  • Prettier for consistent code formatting across the codebase.
  • Husky for Git hooks to automate tasks such as formatting, type-checking, and testing before commits.
  • CI (Continuous Integration) setup with GitHub Actions for automated testing, building, type-checking, and publishing the package to npmjs.

🚀 Getting Started

If you like what you've seen so far and think this setup fits your needs, you can quickly get started by clicking the Use this template button at the top of the repository on GitHub.

🤝 Contributing

Before contributing to this package, please refer to the contributing documentation.

About

A template for creating packages using the React framework and the Vite build tool, and written in TypeScript.

Resources

Contributing

Stars

Watchers

Forks