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
babel
fortypescript
compile - use
jest
and@testing-library/react
for test - use this repo for lint setup
- and includes these libraries:
styled-components
and related babel plugin@material-ui/core
@material-ui/icons
and babel setup for reducing bundle sizereact-router-dom
lodash
and tree-shaking support
- support
sass
[email protected]
for js polyfill
Option one (automatically):
- use corresponding CLI to conveniently fetch and extract this starter.
- then
cd folder
and runnpm install
Option two (manually):
- download this repo and extract it.
- then
cd folder
and runnpm install
npm run start
to start webpack-dev-servernpm run build
to build production codenpm run test
to testnpm run eslint:fix
to 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';