{"library":"rollup-plugin-dev","title":"Rollup Development Server Plugin","description":"rollup-plugin-dev is a Rollup plugin that provides a robust development server for local development workflows. The current stable version is 2.1.0, and it follows a feature-driven release cadence. It's built on Fastify, offering a modern, performant, and extensible server solution, distinguishing it from plugins using less active ecosystems like Koa (which it replaced in v2). Key features include detailed request logging, comprehensive proxying capabilities (with path rewriting), support for URL base paths, and automatic server shutdown when Rollup is not in watch mode. It supports single-page application (SPA) fallback routing and provides extensive configuration options for fine-tuning server behavior and integrating custom Fastify plugins.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install rollup-plugin-dev"],"cli":null},"imports":["import dev from 'rollup-plugin-dev'","import type { RollupDevOptions } from 'rollup-plugin-dev'","import fp from 'fastify-plugin';\nimport dev from 'rollup-plugin-dev';\n\nconst myCustomPlugin = fp(async (server, opts) => { /* ... */ });\n// ... in rollup.config.js\ndev({ extend: myCustomPlugin })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import dev from 'rollup-plugin-dev';\nimport path from 'path';\n\nexport default {\n  input: 'src/main.ts',\n  output: {\n    dir: 'dist',\n    format: 'esm'\n  },\n  plugins: [\n    dev({\n      dirs: [path.resolve(__dirname, 'public'), path.resolve(__dirname, 'dist')],\n      port: 3000,\n      host: '0.0.0.0',\n      spa: true, // Serves index.html for all non-file requests\n      proxy: [\n        { from: '/api', to: 'http://localhost:8000/v1' },\n        { from: '/auth/*', to: 'https://auth.example.com', opts: { rewritePrefix: '/auth' } }\n      ],\n      onListen: (server) => {\n        server.log.info(`Dev server listening on http://${server.server.address().address}:${server.server.address().port}`);\n      }\n    })\n  ]\n};","lang":"typescript","description":"This quickstart configures `rollup-plugin-dev` to serve static files from `public` and `dist` directories, listen on port 3000, enable SPA routing, and proxy API requests.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}