Registry / web-framework / nollup

nollup

JSON →
library0.21.0jsnpmunverified

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.

npm install nollup
INSTALL
IMPORT
SIG · NOLLUP
N
nollup
web-frameworkjavascriptv0.21.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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createServer
import { createServer } from 'nollup';
const { createServer } = require('nollup');
Preferred for starting a development server programmatically. ESM import is recommended for modern Node.js projects.
createCompiler
import { createCompiler } from 'nollup';
const { createCompiler } = require('nollup');
Used for programmatic compilation without the dev server, typically when integrating with custom server setups. Follows Rollup's `rollup()` API pattern.
nollupCLI
npx nollup
import { runCLI } from 'nollup';
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.

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.

import { createServer } from 'nollup'; import path from 'path'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); // Minimal rollup config (e.g., rollup.config.js) const rollupConfig = { input: path.resolve(__dirname, 'src/main.js'), output: { file: 'dist/bundle.js', format: 'esm', sourcemap: true, }, plugins: [], // Add your Rollup plugins here, e.g., @rollup/plugin-node-resolve(), @rollup/plugin-commonjs() }; // Create a basic server.js file to start Nollup async function startDevServer() { const server = await createServer({ config: rollupConfig, port: process.env.PORT ?? 9000, contentBase: path.resolve(__dirname, 'public'), hot: true, // Enable Hot Module Replacement }); server.listen(); console.log(`Nollup dev server listening on http://localhost:${server.port}`); } startDevServer().catch(console.error); // --- src/main.js --- // console.log('Hello from Nollup!'); // document.body.innerHTML = '<h1>Hello Nollup Dev!</h1>'; // --- public/index.html --- // <!DOCTYPE html> // <html lang="en"> // <head> // <meta charset="UTF-8"> // <meta name="viewport" content="width=device-width, initial-scale=1.0"> // <title>Nollup App</title> // </head> // <body> // <script src="/dist/bundle.js"></script> // </body> // </html> // To run: // 1. Create files: server.js, src/main.js, public/index.html as above. // 2. Add "type": "module" to your package.json. // 3. Install: npm install nollup // 4. Run: node server.js
nollup --version
Debug
Known issues
gotchaNollup 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.
fix
Use Rollup itself for production builds, maintaining separate configurations for Nollup (dev) and Rollup (prod).
affects: >=0.1.0
gotchaESM 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.
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.
affects: >=0.1.0
gotchaNollup 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.
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.
affects: >=0.1.0
gotchaOlder 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.
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.
affects: <0.18.5
gotchaThe 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.
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.
affects: >=0.20.1
gotchaTypeScript sourcemaps generated by plugins were not correctly displayed in some setups due to a bug in Nollup.
fix
Upgrade Nollup to version 0.18.7 or newer to ensure correct sourcemap generation and display when using TypeScript plugins.
affects: <0.18.7
Errors
Common errors & fixes
Something imported is undefined.
Nollup disables ESM live-bindings by default for performance reasons, which can lead to `undefined` values for mutable exports.
fix
Enable live-bindings in your Nollup configuration: `output: { ..., liveBindings: true }`.
Error: Cannot find module '<module-id>' (usually with a numeric ID)
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.
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.
Sourcemaps are incorrect or not generated for TypeScript files.
A bug in Nollup versions prior to 0.18.7 prevented proper sourcemap generation and display for plugins like `@rollup/plugin-typescript`.
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.
Dynamic imports break when emitting assets or cause runtime errors.
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.
fix
Upgrade Nollup to version 0.18.4 or later to fix issues related to dynamic imports and asset emission.
Upgrade
Version history
0.21.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
8
Amazon
1
Resources