This is a react template(or called starter) for typescript users, details below:
warning: this repo will try best to keep dependencies the latest and all work well, it doesn't take back-compatibility into consideration.
- use
babelfortypescriptcompile - use
jestand@testing-library/reactfor test - use this repo for lint setup
- and includes these libraries:
styled-componentsand related babel plugin@material-ui/core@material-ui/iconsand babel setup for reducing bundle sizereact-router-domlodashand tree-shaking support
- support
sass core-js@3.xfor js polyfill
Option one (automatically):
- use corresponding CLI to conveniently fetch and extract this starter.
- then
cd folderand runnpm install
Option two (manually):
- download this repo and extract it.
- then
cd folderand runnpm install
npm run startto start webpack-dev-servernpm run buildto build production codenpm run testto testnpm run eslint:fixto automatically fix all fixable errors
-
you can use these alias to import files, current there are four alias available:
import Img from '~images/apple.jpg'; import Button from '~components/Button'; import useCounter from '~hooks/useCounter'; import Index from '~pages/index/Index';