Пример
Enabling @rollup/plugin-commonjs leaves require calls untransformed in files with ES imports unless transformMixedEsModules is explicitly set to true.
sha256:7d74520bd3cbe8b4027fdaefc8257db0bff3f5ebbd8644dd0d7d9f76b692bcdb
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Enabling @rollup/plugin-commonjs leaves require calls untransformed in files with ES imports unless transformMixedEsModules is explicitly set to true. HOW
- Пакеты
- @rollup/plugin-commonjs 28.0.9 rollup 4.62.4
- Окружение
- node
- Создан
- 2026-08-16T15:41:35Z
Что обычно предполагают
By default @rollup/plugin-commonjs transforms require expressions into bundled module imports in any file processed by Rollup.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- assert @rollup/plugin-commonjs without transformMixedEsModules leaves require calls untransformed in files containing ES imports, producing runtime ReferenceError in ESM output
- assert transformMixedEsModules: true converts require calls into bundled CommonJS helper invocations in mixed ESM/CJS files
- assert requireReturnsDefault defaults to false, returning an augmented namespace object with __esModule marker rather than unwrapping default export directly when CJS requires ESM
- assert requireReturnsDefault: 'auto' unwraps the default export directly when an ES module has no named exports, but returns the namespace object if named exports are present
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9