8000 GitHub - wtoldt/vite-react-starter: Template for a new vite-react project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wtoldt/vite-react-starter

Repository files navigation

vite logo

vite-react-starter

Introduction

An opinionated Vite/React/TypeScript/Tailwind starter according to my preferences

Installation

Create the project with pnpm and degit

pnpx degit wtoldt/vite-react-starter my-app

If the second argument is omitted (my-app), the repo will be cloned to the current directory

Set Up Your Project

  1. Replace "vite-react-starter" with your repo name in key files:
    • package.json
    • vite.config.ts
  2. Update index.html with your project details
    • Update <title> tag
    • Add your own favicon
  3. Replace this README.md file with your own
    • Once you're familiar with what's included and how to get started, it's time to say goodbye

Usage

Install dependencies

pnpm install

Serve with hot reload at http://localhost:5173/<project-name>

pnpm run dev

Features

Extra Info

  • Why are there 3 tsconfigs?
    • tsconfig.app.json configures your app (src folder) which runs in the browser environment
    • tsconfig.node.json configures Vite itself which is running on your computer in a Node environment
    • tsconfig.json is the main entry point
      • It contains configuration shared between the environments (like paths)
      • It references the other two tsconfigs
  • Why is there a safelist: ['dark'] property in the Tailwind config?
    • If dark class is not mentioned anywhere in the codebase, Tailwind will inadvertently disable darkmode by removing the dark class as part of it's pruning process. Safelisting classes documentation

About

Template for a new vite-react project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0