Skip to content

Commit 7503ca4

Browse files
committed
Flesh out README
1 parent 5ee6fe1 commit 7503ca4

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Typebundle
22

3-
Zero-config Node.js library bundler with support for Babel-transpiled TypeScript. A work in progress!
3+
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.
44

55
## Installation
66

@@ -11,7 +11,45 @@ npm i -D typebundle
1111
## Usage
1212

1313
```sh
14-
npx typebundle <input> --output=<output_directory>
14+
typebundle <input> [--options]
15+
```
16+
17+
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.
18+
19+
#### A single source file
20+
21+
```sh
22+
typebundle src/index.ts --output dist --target 8
23+
```
24+
25+
#### Multiple source files
26+
27+
```sh
28+
typebundle "src/{cli,index}.ts" --output dist --target 8
29+
```
30+
31+
#### Run in watch mode
32+
33+
```sh
34+
typebundle src/index.ts --output dist --target 8 --watch
35+
```
36+
37+
## Options
38+
39+
```
40+
--output The output directory, defaults to "dist"
41+
42+
--compress If passed, "terser" will be used to minify the output
43+
44+
--target The minimum version of Node.js to target for transpiling, this
45+
is passed directly to "@babel/preset-env" at "targets.node",
46+
defaults to "current"
47+
48+
--types The directory where "d.ts" files are output, defaults to where
49+
--output is set
50+
51+
--watch Watches source files for changes and re-builds, does not output
52+
"d.ts" files for speed
1553
```
1654

1755
## License

0 commit comments

Comments
 (0)