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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tanshenghu/react-builder

v1.0.1

Published

react-builder

Downloads

4

Readme

react-builder

react脚手架

基本功能介绍

建议全局模式安装 < 优点: 项目多就不用重复的去每个项目安装脚手架, 全局安装多项目受用 >

window环境
npm install react-builder -g --registry http://npm.tanshenghu.cn

mac环境
sudo npm install react-builder -g --registry http://npm.tanshenghu.cn

可能安装的过程遇到 current user ("nobody") 遇到创建目录等其它权限问题

sudo npm_config_user=root npm --registry http://npm.tanshenghu.cn install react-builder@latest -g

最新的安装方法
npm install @tanshenghu/react-builder -g
或用 cnpm、 yarn 安装速度更快

新建你的`react`项目工程
无需关心、安装webpack,bable等
直接安装项目代码依赖包
并修改package.json里面的"start": "react-builder dev -p 8080"
然后npm start就能启动项目

命令行 常用参数详解
dev 启动本地开发服务
-p 启动本地服务端口号
--https 启用https
-h 本地服务域名
build 编译打包

脚手架默认已经支持,js,jsx,ts,jsx,css,scss,less,stylus,css-module
antd按需打包默认没有集成在里面,需要在外边自己配一下。

其它常用高级用法

自定义一些webpack插件、loader等
在项目根目录新建一个builder.config.js文件
module.exports = {
    chainWebpack(config) {
        
    },
    babelPlugins: [
      [
        "babel-plugin-import",
        { "libraryName": "antd", "libraryDirectory": "lib", "style": true },
        "ant"
      ]
    ],
    plugins: [],
    themeSkins: {
      themeFile: [
        // 针对antd组件主题颜色修改
        path.resolve('./config/theme/antd_skin.less'),
        // 针对自己项目主题皮肤颜色定义
        path.resolve('./config/theme/variables.styl'),
      ]
    },
    builderDone({ stats }) {
      console.log('打包完成...');
    }
}


在项目程序代码中获取环境变量值
process.env.NODE_ENV   // development   /   production


如果需要大量的自定义数据字段,项目根目录新建project.config.json
{
  "hello": "你好,这里是打包数据配置文件",
  "content": "可以在工程代码的process里面取这里的配置数据",
  "templateParameters": { // index.html 模板数据
    meta: {
      author: 'TanShenghu - 福虎'
    },
    title: 'web网站标题'
  }
}
// 项目程序代码取值
process.projectConfig.content   // 可以在工程代码的process里面取这里的配置数据

了解更多高级用法

Call Me

Appreciate

赞赏码