UNPKG

1.18 kBMarkdownView Raw
1# rollup-watch
2
3This module is used by the [Rollup](https://rollupjs.org) command line interface to enable automatic incremental rebuilds.
4
5Install it to your project like so...
6
7```bash
8npm install --save-dev rollup-watch
9```
10
11...then invoke it by adding the `--watch` flag (or `-w`) to the command that starts Rollup. In this example, `npm run dev` will create your bundle then recreate it whenever its sources change:
12
13```js
14// package.json
15{
16 // ...
17 "scripts": {
18 "build": "rollup -c",
19 "dev": "rollup -c -w"
20 }
21}
22```
23
24
25## Options
26
27You can specify watch options in your rollup.config.js file:
28
29```js
30// rollup.config.js
31export default {
32 entry: 'src/main.js',
33 ...,
34 watch: {
35 chokidar: {
36 // if the chokidar option is given, rollup-watch will
37 // use it instead of fs.watch. You will need to install
38 // chokidar separately.
39 //
40 // this options object is passed to chokidar. if you
41 // don't have any options, just pass `chokidar: true`
42 },
43
44 // include and exclude govern which files to watch. by
45 // default, all dependencies will be watched
46 exclude: ['node_modules/**']
47 }
48};
49```
50
51
52## LICENSE
53
54[MIT](LICENSE)
\No newline at end of file