Skip to content

Commit 8a0a21c

Browse files
committed
additional documentation
1 parent ed2764f commit 8a0a21c

1 file changed

Lines changed: 41 additions & 21 deletions

File tree

README.md

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
<p align="center">
2+
<img src="https://i.imgur.com/MNIzAyI.png" width="300" height="300" alt="microbundle">
3+
<br>
4+
<a href="https://www.npmjs.org/package/microbundle"><img src="https://img.shields.io/npm/v/microbundle.svg?style=flat" alt="npm"></a> <a href="https://travis-ci.org/developit/microbundle"><img src="https://travis-ci.org/developit/microbundle.svg?branch=master" alt="travis"></a>
5+
</p>
6+
17
# Microbundle
28

3-
A zero-configuration bundler for tiny modules, powered by Rollup.
9+
A **zero-configuration** bundler for _tiny modules_, powered by [Rollup].
410

5-
- Reads all the necessary information from your `package.json`
11+
- Bundles your library using nothing but a `package.json`
612
- Supports multiple entry modules (`cli.js` + `index.js`, etc)
7-
- Creates multiple output formats for each entry (CommonJS, UMD & ESM).
13+
- Creates multiple output formats for each entry (CommonJS, UMD & ESM)
814

915
## Installation
1016

@@ -14,40 +20,54 @@ A zero-configuration bundler for tiny modules, powered by Rollup.
1420

1521
```js
1622
{
17-
"scripts": {
18-
"build": "microbundle",
19-
"dev": "microbundle watch"
20-
}
23+
"scripts": {
24+
"build": "microbundle",
25+
"dev": "microbundle watch"
26+
}
2127
}
2228
```
2329

2430
## Usage
2531

32+
33+
### `microbundle` / `microbundle build`
34+
35+
By default, microbundle will infer the location of your source entry file
36+
(the root module in your program) from the `module` field in your `package.json`. It will infer the output directory and filename(s) from the `main` field.
37+
38+
### `microbundle watch`
39+
40+
Watches source files and rebuilds on any change.
41+
42+
2643
```
2744
microbundle [entries..]
2845
2946
Build once and exit
3047
3148
Commands:
32-
cli.js build [entries..] Build once and exit [default]
49+
cli.js build [entries..] Build once and exit [default]
3350
cli.js watch [entries..] Rebuilds on any change
3451
3552
Options:
36-
--version Show version number [boolean]
37-
--entry, -i Entry module(s)
38-
[string] [default: <package.module>]
39-
--output, -o, -d Directory to place build files into
40-
[string] [default: <dirname(package.main), build/>]
41-
--cwd Use an alternative working directory
42-
[string] [default: .]
43-
--format Only build specified formats
44-
[string] [default: es,cjs,umd]
45-
--compress Compress output using UglifyJS
46-
[boolean] [default: true]
47-
--strict Enforce undefined global context and add "use
48-
strict" [default: false]
53+
--version Show version number [boolean]
54+
--entry, -i Entry module(s)
55+
[string] [default: <package.module>]
56+
--output, -o Directory to place build files into
57+
[string] [default: <dirname(package.main), build/>]
58+
--cwd Use an alternative working directory
59+
[string] [default: .]
60+
--format Only build specified formats
61+
[string] [default: es,cjs,umd]
62+
--compress Compress output using UglifyJS
63+
[boolean] [default: true]
64+
--strict Enforce undefined global context and add "use
65+
strict" [default: false]
4966
```
5067

5168
## License
5269

5370
MIT
71+
72+
73+
[Rollup]: https://github.com/rollup/rollup

0 commit comments

Comments
 (0)