Vite React Ts screenshot

Vite React Ts

Author Avatar Theme by Uchihamalolan
Updated: 8 Jan 2023
130 Stars

Vite React-Typescript CRA Replacement Starter Template

Categories

Overview:

This article discusses a drop-in replacement for Create React App (CRA) that is powered by Vite. It highlights various features and additions that come with this replacement, such as the ability to import SVGs directly as React components, unit testing with Jest and React Testing Library, ESLint rules and Prettier configuration, and support for TailwindCSS. It also mentions the usage of degit for easy setup and provides an overview of the tech stack used in this replacement.

Features:

  • Import SVG’s directly as React Component via SVGR
  • Unit Testing via Jest & React Testing Library
  • ESLint Rules & Prettier
  • TailwindCSS support
  • Absolute imports within the src directory
  • Conventional Commits using Commitlint
  • Pre-commit hooks for running lint checks, TypeScript checks, formatting, and unit tests
  • Easy setup with degit

Installation:

To install and use this drop-in replacement, follow these steps:

  1. Install degit globally:
npm install -g degit
  1. Use degit to clone the repository:
degit username/repo
  1. Navigate to the cloned repository:
cd repo
  1. Install the dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Build the project for production:
npm run build
  1. Serve the built project:
npm run serve

Summary:

This article showcases a drop-in replacement for Create React App that is powered by Vite. It provides several key features and additions, including the ability to import SVGs as React components, unit testing with Jest and React Testing Library, ESLint rules and Prettier configuration, support for TailwindCSS, and more. The installation process is straightforward and the article also provides an overview of the tech stack used in this replacement.