首先为什么想到自己实现一个React脚手架呢?是因为之前刚接触create-react-app
时,觉得不太灵活。虽然文件目录很清晰,但是还是觉得不如VueCLI的可以自定义配置更加灵活。当然React官方提供了可以暴露配置的命令npm run eject
,说再多不如自己实现一个。
npm install
npm run dev
npm run build
Webpack configuration item.
Analog data.
Template file.
Babel configuration.
There is no need to add NPM packages.
Postcss configuration file.
Project home folder.
Static folder.
Place to store components.
HTTP request configuration.
Routing configuration.
State management.
Tool library.
Where the page is stored.
Project template.
Project entry document.
https://github.com/maomincoding/ReactCli
可以根据自己的需求自己再进行二次加工。欢迎Star!