Giter Site home page Giter Site logo

gabrielcrackpro / react-vite-ts-starter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 173 KB

Start your next React TS project easily

JavaScript 27.52% HTML 8.65% CSS 1.69% TypeScript 62.13%
react react-typescript react-typescript-boilerplate typescript vite vite-react vite-starter vite-starter-template

react-vite-ts-starter's Introduction

React + Vite + TS Template

Start your next project easily

Features

Import aliases support

Default aliases:

  • @ -> src/
  • @components -> src/components - Custom components
  • @assets -> src/assets - App assests
  • @routes -> src/routes - App routes

Packages

The following packages / files are included

Install

Clone this repository

npx degit GabrielCrackPro/react-vite-ts-starter <app_name>

Run this command in the root directory

  • Install with npm
mpm install
  • Install with yarn
yarn

Available commands

  • Start your project: yarn dev or npm run dev
  • Show all eslint problems yarn lint or npm run lint

For other commands see the package.json file

Add more import aliases

  1. Go to the tsconfig.json file and add this
"paths": {
      "@/*": ["./src/*"],
      "@components/*": ["./src/components/*"],
      "@assets/*": ["./src/assets/*"],
      "@routes/*": ["./src/routes/*"],
      // "@example/*": ["./src/example/*"] Alias example
    }
  1. Go to the vite.config.ts file and add this
plugins: [
react(),
alias({
  entries: [
    { find: "@", replacement: path.resolve(__dirname, "src") },
    { find: "@assets", replacement: path.resolve(__dirname, "src/assets") },
    { find: "@components", replacement: path.resolve(__dirname, "src/components") },
    { find: "@routes", replacement: path.resolve(__dirname, "src/routes") },
    /*
    Alias example:
    { find: "@example", replacement: path.resolve(__dirname, "src/example") },
    */
  ],
});
]

If the components folder or the interfaces folder are not empty remove the .gitkeep file

react-vite-ts-starter's People

Contributors

gabrielcrackpro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.