{"id":15728,"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.","status":"active","version":"0.21.0","language":"javascript","source_language":"en","source_url":"https://github.com/PepsRyuu/nollup","tags":["javascript"],"install":[{"cmd":"npm install nollup","lang":"bash","label":"npm"},{"cmd":"yarn add nollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add nollup","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Preferred for starting a development server programmatically. ESM import is recommended for modern Node.js projects.","wrong":"const { createServer } = require('nollup');","symbol":"createServer","correct":"import { createServer } from 'nollup';"},{"note":"Used for programmatic compilation without the dev server, typically when integrating with custom server setups. Follows Rollup's `rollup()` API pattern.","wrong":"const { createCompiler } = require('nollup');","symbol":"createCompiler","correct":"import { createCompiler } from 'nollup';"},{"note":"While internal CLI logic exists, direct programmatic import of the CLI runner is not a primary or recommended public API. Use `npx nollup` for CLI execution.","wrong":"import { runCLI } from 'nollup';","symbol":"nollupCLI","correct":"npx nollup"}],"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."},"warnings":[{"fix":"Use Rollup itself for production builds, maintaining separate configurations for Nollup (dev) and Rollup (prod).","message":"Nollup is strictly for development and does not perform production-level optimizations like Rollup (e.g., tree-shaking, scope-hoisting). Bundles generated by Nollup are not suitable for production deployment due to their larger size and lack of optimizations.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Enable live-bindings explicitly in your Nollup configuration by setting `liveBindings: true` in your output options or Nollup-specific configuration. Refer to the 'Live Bindings' documentation.","message":"ESM live-bindings are disabled by default for performance. If your application relies on mutable exports (e.g., `export let count = 0;` and then `count++` in another module), you might encounter `undefined` values or unexpected behavior.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consult Nollup's 'Supported Rollup Config Options' documentation to ensure your development configuration aligns with Nollup's capabilities. Always test your production build with actual Rollup.","message":"Nollup only implements Rollup configuration options that are relevant for development. Options primarily focused on production optimizations or niche scenarios may be ignored without warning, leading to discrepancies with your production Rollup build.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade Nollup to version 0.18.5 or newer to resolve this HMR compatibility issue. Ensure your HMR setup aligns with `module.hot` conventions.","message":"Older versions of Nollup (pre-0.18.5) had issues with Hot Module Replacement (`module.hot.accept()`) when used without a callback function, preventing HMR from functioning correctly in those scenarios.","severity":"gotcha","affected_versions":"<0.18.5"},{"fix":"Review your IIFE external import configurations and global variable mappings if upgrading from older versions. Test your application thoroughly if relying on IIFE format and external dependencies.","message":"The behavior for IIFE external imports changed in version 0.20.1, specifically how global variables are searched when a default import is assigned to a variable. This might affect applications relying on specific global variable remapping in IIFE bundles.","severity":"gotcha","affected_versions":">=0.20.1"},{"fix":"Upgrade Nollup to version 0.18.7 or newer to ensure correct sourcemap generation and display when using TypeScript plugins.","message":"TypeScript sourcemaps generated by plugins were not correctly displayed in some setups due to a bug in Nollup.","severity":"gotcha","affected_versions":"<0.18.7"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Enable live-bindings in your Nollup configuration: `output: { ..., liveBindings: true }`.","cause":"Nollup disables ESM live-bindings by default for performance reasons, which can lead to `undefined` values for mutable exports.","error":"Something imported is undefined."},{"fix":"Ensure `@rollup/plugin-node-resolve` and `@rollup/plugin-commonjs` are installed and correctly configured in your Nollup plugins array. Verify that the CommonJS plugin is applied before other plugins that might process the code.","cause":"This error typically occurs when a CommonJS module is used without the `@rollup/plugin-commonjs` being correctly configured or if the plugin fails to transform an unusually structured CommonJS module.","error":"Error: Cannot find module '<module-id>' (usually with a numeric ID)"},{"fix":"Update Nollup to version 0.18.7 or later to resolve sourcemap issues. Also, ensure your TypeScript plugin is up-to-date and correctly configured.","cause":"A bug in Nollup versions prior to 0.18.7 prevented proper sourcemap generation and display for plugins like `@rollup/plugin-typescript`.","error":"Sourcemaps are incorrect or not generated for TypeScript files."},{"fix":"Upgrade Nollup to version 0.18.4 or later to fix issues related to dynamic imports and asset emission.","cause":"A specific bug in Nollup versions prior to 0.18.4 caused dynamic imports to malfunction when combined with asset emission, leading to broken imports or runtime failures.","error":"Dynamic imports break when emitting assets or cause runtime errors."}],"ecosystem":"npm"}