Giter Club home page Giter Club logo

react-ts-webpack-template's Introduction

React TypeScript Template

This is a basic yet opinionated react typescript starter using webpack as bundler, babel as transpiler and pnpm as package-manager.

TL;DR

  1. Check this out and update the project name and version at the top of the package.json file.
  2. run pnpm i to install the dependencies
  3. run dev server via pnpm dev

Prerequisites

  • recent version of Node.js (>= 18)
  • recent version of pnpm (>= 8)

pnpm

We use pnpm so if you don't have it install it via corepack like so:

corepack enable
corepack prepare pnpm@latest --activate
# verify that everything worked
pnpm --version # this should print out the version of the newly installed pnpm

Development

You can start webpack's dev-server via pnpm dev.

Build

Create a production bundle via pnpm build. This will be placed under dist. You could then for example run it (for testing purposes) using a http server of your choice, e.g:

python -m http.server -d dist 8081

or

pnpm dlx http-server ./dist -p 8082 --proxy http://localhost:8082?

QA

There are a set of tools/mechanism that help you enforce formatting and coding standards:

  • formatter (uses prettier): pnpm format
  • linter: (uses eslint with typescript enabled) pnpm lint
  • typechecks: (uses tsc without emitting any code): pnpm typecheck
  • git hooks (via husky): These are maintained in the .husky subfolder and will be installed when you run pnpm i or pnpm prepare. They are executed each time you commit changes and will run the above tools.
  • GitHub workflows (located in .github/workflows): these run in the CI/CD pipeline of Git and run the above tools and also ensures a few guidelines regarding Git, for instance ensuring that the Git history remains linear: https://www.bitsnbites.eu/a-tidy-linear-git-history/.

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.