Giter Club home page Giter Club logo

redbud's Introduction

Redbud

基于 Umi4 架构,提供基础库开发工作流的解决方案。

注意: 本项目主要参考 father@4 的代码实现,并在其中加入自己对基础库开发工作流的一些理解。

经过对目前主流的一些基础库(组件库/工具库等)和打包工具(webpack/rollup/esbuild等)的的研究,得出如何结论:

  1. 编译模式主要分为以下两种
  • Bundle: 将所有文件打包进一个文件;
  • Bundless: 目录对目录;
  1. 编译格式主要分为以下三种
  • esm
  • cjs
  • umd

以 React 技术栈有名的 antd 组件库为例,打包输出目录为 eslibdist 就分别用到了上述两种编译模式

  • eslib 采用的就是 Bundless 模式;
  • dist 采用的就是 Bundle 模式;

father@3 为例,就提供了 babelrollup 两种模式供用户选择。(babel就相当于Bundless模式;rolup就相当于Bundle模式)

✨ 特性

  • 📦 依赖预打包 基于 ncc(打包文件)+ dts-packer(生成类型)
  • 🛰 产物面向未来:默认不再提供 cjs 产物类型
  • ⚔️ 双模式构建
    • Bundle 模式:仅 UMD 产物走 bundle 模式,核心为 webpack
    • Bundless 模式:仅 ESM 产物走 bundless 模式,默认提供 babel(browser)+ esbuild(node)双编译核心,可基于插件系统注册 swc/tsc 模式

🏗 安装

# npm 
$ npm install redbud --save -D

# yarn
$ yarn add redbud -D

# pnpm
$ pnpm i redbud -D

Cli

version

查看 redbud 的版本

$ redbud version

build

redbud's People

Contributors

wangxingkang avatar

Stargazers

Banging avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.