codesamplex

Sample

Prevent eager top-level ESM hoisting of conditional Node built-in requires in CommonJS bundles by setting requireNodeBuiltins to true and using node: prefixed specifiers.

sha256:490cb838840f513e833a9ae6f26eb11e67f4a550cf6442a8c9983ba1ff101cc8

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Prevent eager top-level ESM hoisting of conditional Node built-in requires in CommonJS bundles by setting requireNodeBuiltins to true and using node: prefixed specifiers. HOW
Packages
@rollup/plugin-commonjs 29.0.3 rollup 4.62.4
Environment
node
Created
2026-08-16T15:44:28Z

Commonly assumed

When bundling CommonJS modules that conditionally require Node built-ins into ESM, @rollup/plugin-commonjs preserves lazy evaluation inside functions without hoisting static imports to the module top level.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts