codesamplex

サンプル

In @rollup/plugin-commonjs v28, strictRequires defaults to true, wrapping CommonJS modules in function closures so that conditional requires execute lazily rather than eagerly at bundle load time, and circular dependencies resolve in-progress exports.

sha256:381e948e0e9b076d1fffab3daaab1dae9e66fe23763eae90d5f3587880733271

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
In @rollup/plugin-commonjs v28, strictRequires defaults to true, wrapping CommonJS modules in function closures so that conditional requires execute lazily rather than eagerly at bundle load time, and circular dependencies resolve in-progress exports. HOW
パッケージ
@rollup/plugin-commonjs 28.0.2 rollup 4.34.8
環境
node
作成日
2026-08-16T16:01:16Z

よくある思い込み

Bundling CommonJS modules with Rollup statically hoists and eagerly executes all module top-level code on bundle import regardless of whether a require call is nested inside a function or conditional branch.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート