npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-scaffold-tool

v1.5.0

Published

A react-scaffold built by dangosky

Downloads

18

Readme

React-scaffold-tool

English | 简体中文

描述

一款用于 React 前端项目开发的脚手架,可以快速搭建起一个 React 项目架子。

使用

在计算机上已经装好 Node 开发环境后,全局安装 react-scaffold-tool:

npm install -g react-scaffold-tool

使用 react-scaffold-tool 创建一个新项目:

cli init <项目名称>
cd <项目名称>
npm install

项目模板的目录结构:

├── README.md
├── package.json
├── tsconfig.json
├── images.d.ts // 声明各类图片文件
├── img // 存放图片资源
├── .gitignore
├── .npmrc // 默认指定使用官方的 npm 源
├── .babelrc
├── webpack
│   ├── webpack.common.js // dev 和 prod 的公共 webpack 配置
│   ├── webpack.dev.js // dev 的 webpack 配置
└── src
    ├── App.tsx // 根组件
    ├── index.tsx // 项目入口文件
    ├── style.less // 根组件样式
    ├── index.html // 打包时的 HTML 模板
    ├── api 
    │   ├── index.ts  // 封装了 get 和 post 方法
    │   ├── modules // 后续根据项目模块的划分,在这里添加接口
    ├── pages // 项目业务组件

配置的功能

  • [x] React 相关依赖,包括 React-Router
  • [x] TypeScript 编译
  • [x] Less 编译
  • [x] Babel 编译
  • [x] Antd UI 库
  • [x] 网络模板封装
  • [x] 热重载
  • [ ] Eslint
  • [ ] 打包优化
  • [ ] 构建优化

更新日志

  • 2020/09/17:增加网络请求模板,并且分离出项目模板的开发分支和线上分支。
  • 2020/09/14:初步完成 react-scaffold-tool 并发布 npm 包。
  • 2020/09/11:开始搭建 react-scaffold-tool 脚手架。
  • 2020/09/08:完成项目模板的基本配置,包括 react、ts、less、babel、antd 和热重载等各项配置。
  • 2020/08/29:开始使用 webpack 从零配置一个新项目。

FAQ

  1. Q:为什么不直接使用 create-react-app 等官方脚手架?

A:三点原因,一是 create-react-app 存在诸多限制,它创建出来的新项目模板没有开放 webpack.config.js 等配置文件,需要 npm run eject 去获取,而且该操作不可逆。二是 create-react-app 没有默认配置好 less 和 ts 等 loader,现在的前端项目几乎都采用了 ts 和 less/sass,每次新建项目后都得再手动配置 ts-loader 和 less-loader 很麻烦。三是工具虽好,但不能仅仅停留在会用的程度,需要自己弄清楚工具内部做了什么、是怎么做的,于是乎就有了这么一个契机去自己配置一个脚手架出来了。