Registry / devops / rollup-plugin-live-server

rollup-plugin-live-server

JSON →
library2.0.0jsnpmunverified

A Rollup plugin that wraps live-server to provide a webpack-dev-server-like experience with live reload. Current stable version is 2.0.0. Release cadence is low (last release 2019). Key differentiator: leverages live-server's mature feature set (HTTPS, mounting, open browser, etc.) without reinventing the wheel. Unlike rollup-plugin-serve, it provides live reload via WebSocket injection into HTML files. Suitable for development builds but not actively maintained.

npm install rollup-plugin-live-server
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-LIVE
R
rollup-plugin-live-server
devopsjavascriptv2.0.0
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.

liveServer
import { liveServer } from 'rollup-plugin-live-server'
import liveServer from 'rollup-plugin-live-server'
Exported as a named export, not default
liveServer (CommonJS)
const { liveServer } = require('rollup-plugin-live-server')
const liveServer = require('rollup-plugin-live-server')
CommonJS require must destructure the named export
Options type
import type { Options } from 'rollup-plugin-live-server'
TypeScript users can import the Options type for type safety; not included in original package but may be available in types

Shows how to configure and use the plugin in a Rollup config, including common options like port, root, and file.

// rollup.config.js import { liveServer } from 'rollup-plugin-live-server'; export default { input: 'src/index.js', plugins: [ liveServer({ port: 8001, host: '0.0.0.0', root: 'public', file: 'index.html', open: false, wait: 500, }), ], output: { dir: 'dist', format: 'es', }, };
Debug
Known issues
gotchaPlugin options are passed directly to live-server; consult live-server docs for all options.
fix
Refer to https://www.npmjs.com/package/live-server for full option list.
affects: >=1.0.0
deprecatedPackage last updated in 2019 with no recent maintenance; may not work with Rollup v3+.
fix
Consider alternatives like rollup-plugin-serve or @web/dev-server.
affects: 2.0.0
gotchaThe plugin requires live-server to be installed as a peer dependency. Ensure it's in your package.json.
fix
Run npm install --save-dev live-server.
affects: >=1.0.0
gotchaThe 'mount' option expects an array of arrays, not an object. Incorrect format will cause errors.
fix
Use mount: [['/from', '/to']] format.
affects: >=1.0.0
gotchaThe 'file' option must be a relative path from root, not absolute.
fix
Ensure file is relative, e.g., 'index.html' instead of '/absolute/path/index.html'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'live-server'
live-server is not installed as a peer dependency.
fix
Run: npm install --save-dev live-server
TypeError: plugins[i].name is not a function
Using default import instead of named import.
fix
Use: import { liveServer } from 'rollup-plugin-live-server';
Error: [object Object] is not a valid option for mount
The mount option is provided as an object instead of an array of arrays.
fix
Change mount to an array of tuples: mount: [['/from', '/to']]
Error: Port 8001 is already in use
Another process is using the specified port.
fix
Change the port option or kill the other process.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
live-serverrequiredCore dependency that provides the HTTP server and live reload; this plugin is a thin wrapper around it
Agent activity
6 hits · last 30 days
node
6
Resources
rollup-plugin-live-server — npm install rollup-plugin-live-server · libregistry