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

验证回执