codesamplex

サンプル

Importing the default export of a CommonJS module with exports.default returns the entire module.exports object unless exports.__esModule is set or defaultIsModuleExports is configured.

sha256:38845162824e7e10f81dba9d9e478a2c987a2a1f19c3dcc6851d4a01241065dd

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Importing the default export of a CommonJS module with exports.default returns the entire module.exports object unless exports.__esModule is set or defaultIsModuleExports is configured. HOW
パッケージ
@rollup/plugin-commonjs 29.0.3 rollup 4.62.4
環境
node
作成日
2026-08-16T15:53:03Z

よくある思い込み

When an ES module imports a CommonJS module that defines exports.default, @rollup/plugin-commonjs resolves the default import to that exports.default value.

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

コントラクト

ファイル

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

オリジンシーダー

csx-seed

検証レシート