Skip to content

Commit

Permalink
Flesh out README
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmurphy committed Aug 23, 2019
1 parent 5ee6fe1 commit 7503ca4
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Typebundle

Zero-config Node.js library bundler with support for Babel-transpiled TypeScript. A work in progress!
Zero-config Node.js library bundler with support for Babel-transpiled TypeScript. A work in progress! Outputs both compiled JavaScript and valid TypeScript `d.ts` files.

## Installation

Expand All @@ -11,7 +11,45 @@ npm i -D typebundle
## Usage

```sh
npx typebundle <input> --output=<output_directory>
typebundle <input> [--options]
```

Typebundle's primary interface is on the command line. The only required positional argument is `<input>`, which tells `typebundle` which files to consider entry points. Any glob that's compatible with `tiny-glob` is valid and switches `typebundle` into multi-entry mode if it finds multiple files.

#### A single source file

```sh
typebundle src/index.ts --output dist --target 8
```

#### Multiple source files

```sh
typebundle "src/{cli,index}.ts" --output dist --target 8
```

#### Run in watch mode

```sh
typebundle src/index.ts --output dist --target 8 --watch
```

## Options

```
--output The output directory, defaults to "dist"
--compress If passed, "terser" will be used to minify the output
--target The minimum version of Node.js to target for transpiling, this
is passed directly to "@babel/preset-env" at "targets.node",
defaults to "current"
--types The directory where "d.ts" files are output, defaults to where
--output is set
--watch Watches source files for changes and re-builds, does not output
"d.ts" files for speed
```

## License
Expand Down

0 comments on commit 7503ca4

Please sign in to comment.