{"id":22115,"library":"rollup-plugin-livereload","title":"rollup-plugin-livereload","description":"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.","status":"active","version":"2.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/thgh/rollup-plugin-livereload","tags":["javascript","rollup","rollup-plugin","livereload","lr","typescript"],"install":[{"cmd":"npm install rollup-plugin-livereload","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-livereload","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-livereload","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency providing the LiveReload server implementation","package":"livereload","optional":false}],"imports":[{"note":"ESM default import; CommonJS require works but is not idiomatic.","wrong":"const livereload = require('rollup-plugin-livereload')","symbol":"default (livereload function)","correct":"import livereload from 'rollup-plugin-livereload'"},{"note":"livereload is a factory function, not a constructor.","wrong":"plugins: [new livereload()]","symbol":"livereload","correct":"export default { plugins: [livereload()] }"},{"note":"Pass directory as first argument OR inside options object, not both.","wrong":"livereload('dist', { delay: 300 })","symbol":"livereload with options","correct":"livereload({ watch: 'dist', delay: 300 })"}],"quickstart":{"code":"import livereload from 'rollup-plugin-livereload';\nimport serve from 'rollup-plugin-serve';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife'\n  },\n  plugins: [\n    serve('dist'),\n    livereload({ watch: 'dist', verbose: false })\n  ]\n};","lang":"typescript","description":"Configures rollup-plugin-serve and rollup-plugin-livereload together for a full dev server with auto-reload."},"warnings":[{"fix":"Install and add rollup-plugin-serve plugin to your Rollup config.","message":"livereload() does not start a static file server; it only injects a script and reloads. Use rollup-plugin-serve for serving files.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a relative path like 'dist' or './dist' for the watch directory.","message":"When using the `watch` option, the path must be relative to the project root; absolute paths may not work as expected.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass only `{ key: ..., cert: ... }` for HTTPS.","message":"The `https` option accepts an object with `key` and `cert`; using `pfx` or other properties is not supported and may be removed.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `livereload()` instead of `new livereload()`.","cause":"Importing as a constructor instead of factory function.","error":"Error: livereload is not a function"},{"fix":"Run `npm install --save-dev rollup-plugin-livereload`.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-livereload'"},{"fix":"Specify a different port: `livereload({ port: 35730 })`.","cause":"Default port 35729 is already in use by another LiveReload instance.","error":"Error: EADDRINUSE :::35729"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}