前言
首先为什么想到自己实现一个React脚手架呢?是因为之前刚接触create-react-app时,觉得不太灵活。虽然文件目录很清晰,但是还是觉得不如VueCLI的可以自定义配置更加灵活。当然React官方提供了可以暴露配置的命令npm run eject,说再多不如自己实现一个。
脚手架一览
文档
Project operation
Install
npm install
Start
npm run dev
Build
npm run build
Document implication
build
Webpack configuration item.
mock
Analog data.
public
Template file.
.babelrc
Babel configuration.
.gitignore
There is no need to add NPM packages.
postcss.config.js
Postcss configuration file.
src
Project home folder.
SRC folder main file
assets
Static folder.
component
Place to store components.
request
HTTP request configuration.
router
Routing configuration.
store
State management.
utils