Skip to content

yaolx/cra-template-react-boat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cra-template-react-boat

基于vite构建的react + mobox + typescript 脚手架

create react app

To use this template with Create React App, add --template react-boat when creating a new app. For example:

npx create-react-app my-app --template react-boat

yarn create react-app my-app --template react-boat

react-boat

从零开始搭 vite + reactjs 项目,,并通过 Actions 自动构建,发布

vite + reactjs + typescript + mobx + eslint + json-server

全新vite3.0体验

react-router 6.0

useRouters构造路由

React.Suspense + React.lazy做异步加载

通过import做异步加载

const Home = lazy(() => import('@/page/home'))

json-server

json-server做mock请求,接口定义符合RESTful API 规范

concurrently

concurrently同时启动前端、后端2个服务

命令介绍

  1. yarn mock

本地开发,启动mock请求

  1. yarn build

构建生产环境

  1. yarn server

构建后,用dist目录的静态资源启动服务,并开启mock

  1. yarn json-server

开启json-server,模拟数据接口

About

基于vite的react脚手架

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published