Registry / serialization / fib-rollup

fib-rollup

JSON →
library0.4.0jsnpmunverified

A wrapper for running Rollup inside fibjs, a JavaScript runtime optimized for async I/O with coroutines. Version 0.4.0 allows using Rollup's JavaScript API with top-level await in fibjs's coroutine context. It provides a patched virtual machine (vbox) to emulate Node.js 'module' and other globals, enabling many Rollup plugins to run despite fibjs lacking full Node.js compatibility. Key differentiators: integrates Rollup's ES module bundling with fibjs's fiber-based concurrency; includes an internal 'rollup-plugin-fibjs-resolve' plugin as a fibjs-compatible alternative to 'rollup-plugin-node-resolve'. Limitations: not all Rollup plugins work, and CLI support is planned but not yet implemented.

npm install fib-rollup
INSTALL
IMPORT
SIG · FIB-ROLLUP
F
fib-rollup
serializationjavascriptv0.4.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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

rollup
import { default as rollup } from 'fib-rollup'
const rollup = require('fib-rollup')
fib-rollup exports a default object containing rollup and plugins. Use destructured default import.
plugins
import { plugins } from 'fib-rollup'
const plugins = require('fib-rollup').plugins
The plugins object includes internal plugins like 'rollup-plugin-fibjs-resolve'. Available as named export.
utils
import { utils } from 'fib-rollup'
const utils = require('fib-rollup/utils')
Utilities like vbox are exported under the 'utils' namespace. Direct subpath imports may not work.

Demonstrates using fib-rollup to bundle a JavaScript file with the fibjs-resolve plugin, generating CommonJS output.

const path = require('path'); const { default: rollup, plugins } = require('fib-rollup'); async function build() { const bundle = await rollup.rollup({ input: './src/index.js', plugins: [ plugins['rollup-plugin-fibjs-resolve']() ] }).catch(e => console.error(e)); if (bundle) { const { code } = await bundle.generate({ format: 'cjs' }).catch(e => console.error(e)); console.log(code); } } build();
Debug
Known issues
gotchaNot all Rollup plugins are compatible with fibjs due to missing Node.js APIs.
fix
Use only plugins known to work (e.g., rollup-plugin-commonjs) or test with fibjs's vbox. See plugin compatibility list in the docs.
affects: >=0.0.1
gotchafib-rollup uses a custom module resolution; some plugin imports may fail.
fix
If a plugin fails, try using the provided vbox.getCustomizedVBox to patch missing modules.
affects: >=0.0.1
gotchaTop-level await is only supported in fibjs >=0.26.1.
fix
Upgrade fibjs to version >=0.26.1 or wrap code in an async function.
affects: <0.26.1
gotchaCLI mode is not implemented; only JavaScript API is available.
fix
Use the programmatic API as shown in the quickstart.
affects: <=0.4.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-node-resolve'
The plugin is not compatible with fibjs's module system.
fix
Use 'rollup-plugin-fibjs-resolve' (built-in) instead.
TypeError: module is not a function
fibjs lacks the Node.js 'module' module.
fix
Ensure your script runs inside the vbox by using 'vbox.require' or the default rollup export.
SyntaxError: await is only valid in async function
fibjs version <0.26.1 does not support top-level await.
fix
Wrap your code in an async function or upgrade fibjs.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fib-rollup — npm install fib-rollup · libregistry