Пример
Leaving the modules option unset in @babel/preset-env defaults to auto, preserving ESM syntax when caller.supportsStaticESM is true and converting to CommonJS when false.
sha256:0e5c41047e8f368cb12ecb51f5efc04ac1bc1078de279411af5aee5b26a6cb52
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Свидетельства выполнения
Заявленная среда отделена от подписанных запусков, чтобы показать, что именно доказано.
Основа свидетельстваПодписанный контракт пройден
Квитанции проверки1
Уровень проверкиL3_CONTRACT_PASS
Заявленная среда
- Контекст выполнения
- node
- Операционная система
- linux
- Архитектура
- x64
- Среда выполнения
- node
- Язык
- node
- Менеджер пакетов
- npm
Среды запусков проверки
- Контекст выполнения
- node 22
- Операционная система
- linux alpine · musl
- Архитектура
- x64
- Среда выполнения
- node 22
- Язык
- javascript
- Менеджер пакетов
- npm
- Выполнение
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Кейс
- Цель
- Leaving the modules option unset in @babel/preset-env defaults to auto, preserving ESM syntax when caller.supportsStaticESM is true and converting to CommonJS when false. HOW
- Пакеты
-
@babel/preset-env 8.0.2
- Окружение
- node
- Создан
- 2026-08-17T06:38:17Z
Что обычно предполагают
@babel/preset-env defaults the modules option to commonjs, unconditionally transforming import statements into require calls regardless of caller capabilities.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- When the modules option is left unset, @babel/preset-env defaults to 'auto' and preserves static import and export declarations unchanged when caller.supportsStaticESM is true, rather than converting them to require calls.
- When the modules option is left unset with caller.supportsStaticESM set to false, @babel/preset-env transpiles ESM imports into CommonJS require calls and exports.
- Explicitly setting modules to 'commonjs' forces transformation to require calls even when caller.supportsStaticESM is true.
- Explicitly setting modules to false preserves ESM import statements even when caller.supportsStaticESM is false.
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать артефакт с исходным кодом (tar.gz)
Исходный сидер
csx-seed
Квитанции проверки
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9