# bilix

> bili for fjc0k

Latest version **0.0.1** (published 2017-06-10) · MIT license · 0 weekly downloads

## Install

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

Provides the command `bilix`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-06-10 |
| First published | 2017-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 20 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1030 |
| Author | EGOIST |
| Maintainers | funch |
| Keywords | rollup, esnext, compile, babel, buble, es6 |

## Links

- npm: https://www.npmjs.com/package/bilix
- Repository: https://github.com/egoist/bili
- Homepage: https://github.com/egoist/bili#readme
- Issues: https://github.com/egoist/bili/issues
- npm.io page: https://npm.io/package/bilix

## Dependencies (20)

- [cac](https://npm.io/package/cac.md) ^3.0.4
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [rollup](https://npm.io/package/rollup.md) 0.39.2
- [req-cwd](https://npm.io/package/req-cwd.md) ^2.0.0
- [switchy](https://npm.io/package/switchy.md) ^0.1.0
- [camelcase](https://npm.io/package/camelcase.md) ^4.1.0
- [fancy-log](https://npm.io/package/fancy-log.md) ^1.2.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.0
- [rollup-watch](https://npm.io/package/rollup-watch.md) ^2.5.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^2.1.0
- [stringify-author](https://npm.io/package/stringify-author.md) ^0.1.3
- [rollup-plugin-flow](https://npm.io/package/rollup-plugin-flow.md) ^1.1.1
- [rollup-plugin-json](https://npm.io/package/rollup-plugin-json.md) ^2.1.1
- [rollup-plugin-alias](https://npm.io/package/rollup-plugin-alias.md) ^1.3.1
- [rollup-plugin-async](https://npm.io/package/rollup-plugin-async.md) ^1.2.0
- [rollup-plugin-buble](https://npm.io/package/rollup-plugin-buble.md) ^0.15.0
- [rollup-plugin-uglify](https://npm.io/package/rollup-plugin-uglify.md) ^1.0.2
- [rollup-plugin-replace](https://npm.io/package/rollup-plugin-replace.md) ^1.1.1
- [rollup-plugin-commonjs](https://npm.io/package/rollup-plugin-commonjs.md) ^8.0.2
- [rollup-plugin-node-resolve](https://npm.io/package/rollup-plugin-node-resolve.md) ^3.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-06-10

## README

<h1 align="center">bili</h1>

<p align="center">
  <a href="https://npmjs.com/package/bili"><img src="https://img.shields.io/npm/v/bili.svg?style=flat" alt="NPM version"></a>
<a href="https://npmjs.com/package/bili"><img src="https://img.shields.io/npm/dm/bili.svg?style=flat" alt="NPM downloads"></a>
<a href="https://circleci.com/gh/egoist/bili/tree/master"><img src="https://img.shields.io/circleci/project/egoist/bili/master.svg?style=flat"></a>
<a href="https://codecov.io/gh/egoist/bili"><img src="https://img.shields.io/codecov/c/github/egoist/bili.svg?style=flat"></a>
</p>

## Introduction

Running command `bili` it will compile `src/index.js` to:

```bash
dist/[name].common.js # commonjs format
```

The `[name]` is `name` in `package.json` or `index` as fallback.

You can also generate UMD bundle and compress it with: `bili --format umd --compress`, then you get:

```bash
dist/[name].js          # umd format
dist/[name].min.js      # umd format and compressed
dist/[name].min.js.map  # sourcemap
```

Not enough? You can have them all in one command `bili --format cjs --format es --format umd --compress`:

```bash
dist/[name].js          # umd format
dist/[name].min.js      # umd format and compressed
dist/[name].min.js.map  # sourcemap
dist/[name].common.js   # commonjs format
dist/[name].es.js       # es-modules format
```

**Note:** In `UMD` format all third-party libraries will be bundled in dist files, while in other formats they are excluded.

## Install

```bash
npm install -g bili
```

[Dive into the documentation](https://egoistian.com/bili/) if you are ready to bundle!

## FAQ

### Why not use Rollup's `targets` option?

As per Rollup [wiki](https://github.com/rollup/rollup/wiki/Command-Line-Interface#targets):

```js
import buble from 'rollup-plugin-buble'

export default {
  entry: 'src/main.js',
  plugins: [ buble() ],
  targets: [
    { dest: 'dist/bundle.cjs.js', format: 'cjs' },
    { dest: 'dist/bundle.umd.js', format: 'umd' },
    { dest: 'dist/bundle.es.js', format: 'es' },
  ]
}
```

You can use an array as `targets` to generate bundles in multiple formats, which is really neat and helpful.

However, you can't apply different plugins to different target, which means you still need more config files. For example, add `rollup-plugin-node-resolve` and `rollup-plugin-commonjs` in `umd` build, and what about minification? It's yet another config file.

While in bili, it's as simple as running:

```bash
bili src/main.js --format cjs --format umd --format es --compress
```

Everything can be done via CLI options, if it's too long to read, you can keep them in `bili` field in `package.json`:

```js
{
  "bili": {
    "entry": "src/main.js",
    "format": ["cjs", "umd", "es"],
    "compress": true // note: it only compresses umd bundle and will generate sourcemaps
  }
}
```

## License

MIT © [EGOIST](https://github.com/egoist)

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