A Rollup plugin to serve bundled files during development with a configurable static server. Current stable version is 3.0.0, released sporadically with updates when needed. Key differentiators: zero-config setup, built-in HTTPS support, history API fallback for SPAs, and multiple content base directories. Compared to alternatives like rollup-plugin-dev, it is lighter and mimics webpack-dev-server options. Supports Rollup v0.60+ for v3, older versions available for earlier Rollup. Ships TypeScript types.
npm install rollup-plugin-serveVerified import paths — ran on the pinned version, not inferred.
Minimal Rollup config using serve plugin to host the dist folder on port 3000 and open the browser.
Upgrade Rollup to >= 0.60.0 or use rollup-plugin-serve@0.
Use `import serve from 'rollup-plugin-serve'` instead of `import { serve } from 'rollup-plugin-serve'`.Use `serve({ open: '/different/page' })` instead of `serve({ open: true, openPage: '/different/page' })`.Use `contentBase: ['dist', 'static']` for multiple folders.
Set `historyApiFallback: '/200.html'` (with leading slash).
Switch to ESM import syntax or use dynamic import().
Use `import serve from 'rollup-plugin-serve'`.
Set contentBase to a string like './dist' or an array.