前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >自己实现一个自定义React项目脚手架「ReactCli」

自己实现一个自定义React项目脚手架「ReactCli」

作者头像
Vam的金豆之路
发布2021-12-01 09:13:32
4460
发布2021-12-01 09:13:32
举报
文章被收录于专栏:前端历劫之路

前言

首先为什么想到自己实现一个React脚手架呢?是因为之前刚接触create-react-app时,觉得不太灵活。虽然文件目录很清晰,但是还是觉得不如VueCLI的可以自定义配置更加灵活。当然React官方提供了可以暴露配置的命令npm run eject,说再多不如自己实现一个。

脚手架一览

文档

Project operation

Install
代码语言:javascript
复制
npm install
Start
代码语言:javascript
复制
npm run dev
Build
代码语言:javascript
复制
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

Tool library.

view

Where the page is stored.

App.jsx

Project template.

index.js

Project entry document.

源码地址

代码语言:javascript
复制
https://github.com/maomincoding/ReactCli

结语

可以根据自己的需求自己再进行二次加工。欢迎Star!

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-09-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 前端历劫之路 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 脚手架一览
  • 文档
    • Project operation
      • Install
      • Start
      • Build
    • Document implication
      • build
      • mock
      • public
      • .babelrc
      • .gitignore
      • postcss.config.js
      • src
    • SRC folder main file
      • assets
      • component
      • request
      • router
      • store
      • utils
      • view
      • App.jsx
      • index.js
  • 源码地址
  • 结语
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档