# tbuild

> build tools set

Latest version **0.3.6** (published 2012-08-22) · 0 weekly downloads

## Install

```sh
npm install tbuild
pnpm add tbuild
yarn add tbuild
bun add tbuild
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2012-08-22 |
| First published | 2012-03-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Harry |
| Maintainers | czy88840616 |
| Keywords | kissy, build |

## Links

- npm: https://www.npmjs.com/package/tbuild
- Repository: https://github.com/czy88840616/tbuild
- Issues: https://github.com/czy88840616/tbuild/issues
- npm.io page: https://npm.io/package/tbuild

## Dependencies (3)

- [colors](https://npm.io/package/colors.md) >=0.6.0-1
- [css-combo](https://npm.io/package/css-combo.md) >=0.2.1
- [iconv-lite](https://npm.io/package/iconv-lite.md) >=0.1.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.3.6 (latest) — 2012-08-22
- 0.3.5 — 2012-08-18
- 0.3.4 — 2012-07-31
- 0.3.3 — 2012-06-25
- 0.3.2 — 2012-06-13
- 0.2.1 — 2012-05-12
- 0.2.0 — 2012-03-28
- 0.1.6 — 2012-03-27

## README

# tbuild

包括了一些常用的打包工具，java to nodejs

## 安装
    npm install tbuild

or

    git clone git://github.com/czy88840616/tbuild.git

## 包含的工具有
* ModuleComplier：KISSY(>=1.2) ModuleComplier的nodejs版本
* EasyCombo：一个简单的合并文件工具

### ModuleComplier

*Example:*

    var ModuleComplier = require('tbuild').ModuleComplier;

    // 这里和KISSY.config一样，先配置包
    ModuleComplier.config({
        packages: [{
            'name': 'sh',
            'path': '这里建议写绝对路径',
            'charset': 'gbk'
        }]
    });

    ModuleComplier.build('xxx.js', 'xxx.combine.js');

*API:*

    ModuleComplier.config(cfg);
    ModuleComplier.build(inputPath, outputPath);

* cfg:{Object} 参数

    * packages：{Array} KISSY的包。参见：http://docs.kissyui.com/1.2/docs/html/api/seed/loader/add.html#packages
    * suffix：{String} 输出的文件名后缀，不带.js，比如打包后你想输出为xxx.combine.js，那么这里就配置为：.combine,
    * map: {Array} 类似于KISSY的map方法，可以自己定义把模块名中的路径进行替换，比如把header/abc这个模块名替换为header/cdef，就应该这么配置：map: [['header/abc', 'header/cdef']]；map可以叠加

* inputPath: {String} 需要打包的文件路径或者目录
* outputPath: {String} 需要输出的文件路径

### EasyCombo

*Example:*

    var EasyCombo = require('tbuild').EasyCombo;

    EasyCombo.build({
        base:'D:\\project\\tradeface\\assets\\4.0',
        outputBase:'D:\\project\\tradeface\\assets\\testbuild',
        output:'tc/cart/cart.combine.css',
        includes:[
            'tc/cart/cart.css',
            'tc/cart/order.css',
            'tc/cart/item.css'
        ]
    });

*API:*

    EasyComplier.build(cfg);

* cfg:{Object} 参数

    * base：{String} 需要打包的根目录，可以使用相对路径
    * outputBase：{String} 输出目录，可选，如果不填，那么output将以base作为根目录
    * output：{String} 输出文件，相对路径
    * includes: {Array} 基于base的等待打包文件列表
    * inputEncoding：{String} 输入文件编码，可选，默认GBK
    * outputEncoding：{String} 输出文件编码，可选，默认GBK

### CssCombo

*API:*

    参见https://github.com/daxingplay/css-combo

## License
tbulid 遵守 "MIT"：https://github.com/czy88840616/tbuild/blob/master/LICENSE.md 协议

---
_Source: https://npm.io/package/tbuild · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
