Registry / devops / rollup-plugin-livereload

rollup-plugin-livereload

JSON →
library2.0.5jsnpmunverified

A Rollup plugin that integrates LiveReload functionality, automatically reloading the browser when the bundle changes. Currently at version 2.0.5, it supports Node >=8.3 and ships TypeScript definitions. It wraps the `livereload` npm package, allowing configuration of watch directories, port, delay, and HTTPS. Unlike generic watchers, it is tailored for Rollup's build pipeline, pairing well with `rollup-plugin-serve`. The plugin watches the output directory for changes and notifies the browser via WebSocket, eliminating manual refresh during development. It has been stable for several years with low maintenance overhead.

npm install rollup-plugin-livereload
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-LIVE
R
rollup-plugin-livereload
devopsjavascriptv2.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (livereload function)
import livereload from 'rollup-plugin-livereload'
const livereload = require('rollup-plugin-livereload')
ESM default import; CommonJS require works but is not idiomatic.
livereload
export default { plugins: [livereload()] }
plugins: [new livereload()]
livereload is a factory function, not a constructor.
livereload with options
livereload({ watch: 'dist', delay: 300 })
livereload('dist', { delay: 300 })
Pass directory as first argument OR inside options object, not both.

Configures rollup-plugin-serve and rollup-plugin-livereload together for a full dev server with auto-reload.

import livereload from 'rollup-plugin-livereload'; import serve from 'rollup-plugin-serve'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife' }, plugins: [ serve('dist'), livereload({ watch: 'dist', verbose: false }) ] };
Debug
Known issues
gotchalivereload() does not start a static file server; it only injects a script and reloads. Use rollup-plugin-serve for serving files.
fix
Install and add rollup-plugin-serve plugin to your Rollup config.
affects: >=0.0.0
gotchaWhen using the `watch` option, the path must be relative to the project root; absolute paths may not work as expected.
fix
Use a relative path like 'dist' or './dist' for the watch directory.
affects: >=0.0.0
deprecatedThe `https` option accepts an object with `key` and `cert`; using `pfx` or other properties is not supported and may be removed.
fix
Pass only `{ key: ..., cert: ... }` for HTTPS.
affects: >=2.0.0
Errors
Common errors & fixes
Error: livereload is not a function
Importing as a constructor instead of factory function.
fix
Use `livereload()` instead of `new livereload()`.
Error: Cannot find module 'rollup-plugin-livereload'
Package not installed or missing from node_modules.
fix
Run `npm install --save-dev rollup-plugin-livereload`.
Error: EADDRINUSE :::35729
Default port 35729 is already in use by another LiveReload instance.
fix
Specify a different port: `livereload({ port: 35730 })`.
Upgrade
Version history
2.0.5latest on npm
Audit
Dependencies
livereloadrequiredCore dependency providing the LiveReload server implementation
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-livereload — npm install rollup-plugin-livereload · libregistry