Skip to content

Commit 39cfa9a

Browse files
committed
clean up and update readme
1 parent 7545364 commit 39cfa9a

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

README.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,49 @@
11
# rollup-plugin-unassert
22

3-
[Rollup](http://www.rollupjs.org) plugin to remove assertion calls via [Unassert](https://github.com/unassert-js/unassert)
4-
5-
## Installation
6-
7-
```bash
8-
yarn add --dev rollup-plugin-unassert
9-
```
10-
or
11-
```bash
12-
npm install --save-dev rollup-plugin-unassert
13-
```
14-
3+
A [Rollup](http://www.rollupjs.org) plugin to remove assertion calls via [Unassert](https://github.com/unassert-js/unassert).
154

165
## Usage
176

18-
As with any other Rollup plugin, just add it to the `plugins` option in your RollupJS config:
7+
Install (`npm install --save-dev rollup-plugin-unassert` or `yarn add --dev rollup-plugin-unassert`),
8+
then add it to the `plugins` section of your Rollup config as follows:
199

2010
```js
21-
// In rollup.config.js
22-
import rollupUnassert from 'rollup-plugin-unassert'
11+
import unassert from 'rollup-plugin-unassert'
2312

2413
export default {
25-
entry: 'src/index.js',
26-
dest: 'dist/my-lib.js',
14+
...
2715
plugins: [
28-
rollupUnassert()
16+
unassert()
2917
]
3018
};
3119
```
3220

3321
### Available options
3422

3523
This plugin accepts the following options:
24+
3625
* `include`: A minimatch pattern or array of minimatch patterns, controlling which files are to be handled by this plugin. By default matches `*.js` only.
3726
* `exclude`: A minimatch pattern or array of minimatch patterns, controlling which files are to be ignored by this plugin. By default it's empty.
3827
* `sourcemap`: A boolean controlling whether to handle any existing sourcemaps, defaults to `true`. Setting this to `false` will hide the assert calls when debugging the generated bundle.
3928
* `assertionPatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).
4029
* `requirePatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).
4130
* `importPatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).
4231

43-
e.g.:
32+
### Example Rollup config
4433

4534
```js
46-
// In rollup.config.js
47-
import rollupUnassert from 'rollup-plugin-unassert'
35+
import unassert from 'rollup-plugin-unassert';
4836

4937
export default {
50-
entry: 'src/index.js',
51-
dest: 'dist/my-lib.js',
38+
input: 'src/index.js',
39+
output: {
40+
file: 'dist/my-lib.js',
41+
},
5242
plugins: [
53-
rollupUnassert({
43+
unassert({
5444
exclude: 'test/**/**.js',
55-
requirePatterns: [ 'assert = require("assert")' ]
56-
}),
45+
requirePatterns: ['assert = require("assert")']
46+
})
5747
]
5848
};
5949
```
@@ -65,7 +55,6 @@ export default {
6555
can do whatever you want with this stuff. If we meet some day, and you think
6656
this stuff is worth it, you can buy me a beer in return.
6757

68-
69-
Also, thanks for Takuto Wada for https://github.com/unassert-js/unassertify , from
58+
Also, thanks to Takuto Wada for https://github.com/unassert-js/unassertify, from
7059
which this project takes a lot of the code to wrap unassert.
7160

0 commit comments

Comments
 (0)