Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lukeed/bundt

A simple bundler for your delicious modules
https://github.com/lukeed/bundt

Last synced: about 1 month ago
JSON representation

A simple bundler for your delicious modules

Awesome Lists containing this project

README

        


bundt



CI


version


downloads

A simple bundler for your delicious modules~!

## Features

* Release CommonJS, ES Module, and UMD targets
* Easily configured through your `package.json`
* Optionally control Terser settings

***Gotchas***

Your code is prepared for release targets ***as written***!

* Does not transpile your code
_AKA – no Babel or Buble_
* Does not inline dependencies
_AKA – no Rollup or Webpack_

If you need either of these, using [`microbundle`](https://github.com/developit/microbundle) comes ***highly recommended***!

> Seriously, I write wonky ES5 code in a single file...
`bundt` only puts a name to the builder script I copy & paste between libraries.
You are 99.9999% more likely to do better with `microbundle` and/or to not outgrow it.

## Install

```
$ npm install --save-dev bundt
```

## Usage

```sh
# display help text
$ bundt --help

# build with "lib/index.js" as your entry file
$ bundt lib/index.js

# build with "src/index.js" (default)
$ bundt
```

## Configuration

Most configuration lives within your `package.json` file. The following keys are evaluated:

* **"main"** — the destination for your CommonJS file
_Defaults to `dist/{pkg.name}.js` – always built!_

* **"module"** — the destination for your ES Module file
_A ESM file will not be built if unspecified!_

* **"unpkg"** or **"umd:main"** — the destination for your UMD file
_A UMD file will not be built if unspecified!_

* **"umd:name"** or **"name"** — the globally exposed name for your UMD factory
_You should use an alternate `umd:name` if your `name` is not alphanumeric!_

* **"modes"** — a map of "mode" names and their entry files
_Your `"default"` mode will use the destinations defined above.
All other modes replace `dist` with its name as the new directory._

* **"terser"** — custom [Terser options](https://github.com/terser-js/terser#minify-options) for minification
_Alternatively, you may use a `.terserrc` file~!_

## License

MIT © [Luke Edwards](https://lukeed.com)


Logo by [iconicbestiary](https://www.freepik.com/free-vector/various-desserts-bakery_1310918.htm#page=2&position=38)