React Webpack Typescript Starter
Minimal starter with hot module replacement (HMR) for rapid development.
- React (17.x)
- Webpack (5.x)
- Typescript (4.x)
- Hot Module Replacement (HMR) (React Hot Loader)
- Production build script (Webpack)
- Image loading/minification (Image Webpack Loader)
- SASS support
- Code linting (ESLint) and formatting (Prettier)
- Test framework (Jest)
Installation
- Clone/download repo
yarn install(ornpm installfor npm)
Usage
Development
yarn run start-dev
- Build app continuously (HMR enabled)
- App served @
http://localhost:8080
Production
yarn run start-prod
- Build app once (HMR disabled) to
/dist/ - App served @
http://localhost:3000
All commands
| Command | Description |
|---|---|
yarn run start-dev |
Build app continuously (HMR enabled) and serve @ http://localhost:8080 |
yarn run start-prod |
Build app once (HMR disabled) to /dist/ and serve @ http://localhost:3000 |
yarn run build |
Build app to /dist/ |
yarn run test |
Run tests |
yarn run lint |
Run linter |
yarn run lint --fix |
Run linter and fix issues |
yarn run start |
(alias of yarn run start-dev) |
Note: replace yarn with npm in package.json if you use npm.