{"library":"nollup","title":"Nollup: Rollup-compatible Dev Bundler","description":"Nollup is a Rollup-compatible bundler specifically engineered for rapid development workflows, currently at version 0.21.0. Unlike Rollup, which focuses on production-optimized bundles through aggressive tree-shaking and scope-hoisting, Nollup intentionally skips these optimizations to achieve exceptionally fast rebuild times. This makes it ideal for local development, enabling features like Hot Module Replacement (HMR) using existing `module.hot` conventions. It maintains compatibility with standard Rollup plugins and configuration files, allowing developers to leverage their existing Rollup ecosystem for application development. Nollup offers several modes of operation, including a CLI, Dev Server API, Dev Middleware API, and Compiler API, supporting frequent releases with a focus on developer experience.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install nollup"],"cli":{"name":"nollup","version":null}},"imports":["import { createServer } from 'nollup';","import { createCompiler } from 'nollup';","npx nollup"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createServer } from 'nollup';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Minimal rollup config (e.g., rollup.config.js)\nconst rollupConfig = {\n  input: path.resolve(__dirname, 'src/main.js'),\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm',\n    sourcemap: true,\n  },\n  plugins: [], // Add your Rollup plugins here, e.g., @rollup/plugin-node-resolve(), @rollup/plugin-commonjs()\n};\n\n// Create a basic server.js file to start Nollup\nasync function startDevServer() {\n  const server = await createServer({\n    config: rollupConfig,\n    port: process.env.PORT ?? 9000,\n    contentBase: path.resolve(__dirname, 'public'),\n    hot: true, // Enable Hot Module Replacement\n  });\n\n  server.listen();\n  console.log(`Nollup dev server listening on http://localhost:${server.port}`);\n}\n\nstartDevServer().catch(console.error);\n\n// --- src/main.js ---\n// console.log('Hello from Nollup!');\n// document.body.innerHTML = '<h1>Hello Nollup Dev!</h1>';\n\n// --- public/index.html ---\n// <!DOCTYPE html>\n// <html lang=\"en\">\n// <head>\n//     <meta charset=\"UTF-8\">\n//     <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n//     <title>Nollup App</title>\n// </head>\n// <body>\n//     <script src=\"/dist/bundle.js\"></script>\n// </body>\n// </html>\n\n// To run:\n// 1. Create files: server.js, src/main.js, public/index.html as above.\n// 2. Add \"type\": \"module\" to your package.json.\n// 3. Install: npm install nollup\n// 4. Run: node server.js","lang":"javascript","description":"Demonstrates how to programmatically set up and start a Nollup development server using its `createServer` API, along with a minimal Rollup configuration and sample client-side files for a web application. It includes HMR and content serving from a public directory.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}