# rollup-plugin-livereload

> Rollup plugin for LiveReload that watches the bundle and reloads the page on change

Latest version **2.0.5** (published 2021-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-livereload
pnpm add rollup-plugin-livereload
yarn add rollup-plugin-livereload
bun add rollup-plugin-livereload
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2021-06-29 |
| First published | 2016-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.3 |
| Dependencies | 1 |
| Unpacked size | 14 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 161 |
| Author | Thomas Ghysels |
| Maintainers | thgh |
| Keywords | rollup, rollup-plugin, livereload, lr |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-livereload
- Repository: https://github.com/thgh/rollup-plugin-livereload
- Issues: https://github.com/thgh/rollup-plugin-livereload/issues
- npm.io page: https://npm.io/package/rollup-plugin-livereload

## Dependencies (1)

- [livereload](https://npm.io/package/livereload.md) ^0.9.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.0.5 (latest) — 2021-06-29
- 2.0.0-0 (rc) — 2020-08-27
- 2.0.4 — 2021-06-29
- 2.0.3 — 2021-06-29
- 2.0.2 — 2021-06-29
- 2.0.1 — 2021-06-29
- 2.0.0 — 2020-08-27
- 1.3.0 — 2020-04-28
- 1.2.0 — 2020-04-11
- 1.1.0 — 2020-03-19
- 1.0.4 — 2019-10-05
- 1.0.3 — 2019-09-23
- 1.0.2 — 2019-09-23
- 1.0.1 — 2019-06-13
- 1.0.0 — 2019-01-27
- … 11 more at https://npm.io/package/rollup-plugin-livereload/versions

## README

# Rollup plugin LiveReload

<a href="LICENSE">
  <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="Software License" />
</a>
<a href="https://github.com/thgh/rollup-plugin-livereload/issues">
  <img src="https://img.shields.io/github/issues/thgh/rollup-plugin-livereload.svg" alt="Issues" />
</a>
<a href="http://standardjs.com/">
  <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg" alt="JavaScript Style Guide" />
</a>
<a href="https://npmjs.org/package/rollup-plugin-livereload">
  <img src="https://img.shields.io/npm/v/rollup-plugin-livereload.svg?style=flat-squar" alt="NPM" />
</a>
<a href="https://github.com/thgh/rollup-plugin-livereload/releases">
  <img src="https://img.shields.io/github/release/thgh/rollup-plugin-livereload.svg" alt="Latest Version" />
</a>

## Installation

```
npm install --save-dev rollup-plugin-livereload
```

## Usage

```js
// rollup.config.js
import livereload from 'rollup-plugin-livereload'

export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [livereload()],
}
```

To make it a real dev-server, combine this plugin with [rollup-plugin-serve].

```js
// rollup.config.js
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'

export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [
    serve(), // index.html should be in root of project
    livereload(),
  ],
}
```

### Options

By default, it watches the current directory. If you also have css output, pass the folder to which the build files are written.

```
livereload('dist')

// --- OR ---

livereload({
  watch: 'dist',
  verbose: false, // Disable console output

  // other livereload options
  port: 12345,
  delay: 300,
  https: {
      key: fs.readFileSync('keys/agent2-key.pem'),
      cert: fs.readFileSync('keys/agent2-cert.pem')
  }
})
```

Options are always passed to [`livereload.createServer()`][livereload]

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Contributions and feedback are very welcome.

To get it running:

1. Clone the project.
2. `npm install`
3. `npm run build`

## Credits

- [Thomas Ghysels](https://github.com/thgh)
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.

[link-author]: https://github.com/thgh
[link-contributors]: ../../contributors
[livereload]: https://www.npmjs.com/package/livereload
[rollup-plugin-serve]: https://www.npmjs.com/package/rollup-plugin-serve

---
_Source: https://npm.io/package/rollup-plugin-livereload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
