Пример
Demonstrate that @babel/preset-env with default modules auto mode unconditionally transpiles export namespace from syntax regardless of modern targets unless modules is false or the caller asserts namespace support.
sha256:d1c4e6d5b5f6d67cedb5e95f468a787b2752c4c69b6ef2c96f4bf0ecf8b87ed3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Demonstrate that @babel/preset-env with default modules auto mode unconditionally transpiles export namespace from syntax regardless of modern targets unless modules is false or the caller asserts namespace support. HOW
- Пакеты
- @babel/preset-env 8.0.2 @babel/core 8.0.1
- Окружение
- node
- Создан
- 2026-08-17T01:45:46Z
Что обычно предполагают
Targeting modern JavaScript runtimes with @babel/preset-env and default modules: 'auto' preserves native export * as ns syntax because the targeted environments natively support ECMAScript namespace re-exports.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- When modules is unset or 'auto', @babel/preset-env unconditionally injects transform-export-namespace-from and desugars export * as ns statements even when targeting modern runtimes like Chrome 120 or Node 22, unless modules is explicitly false or the caller declares supportsExportNamespaceFrom.
- assert targets: { chrome: '120' } under default modules: 'auto' desugars export * as ns into separate import and export statements
- assert setting modules: false preserves native export * as ns syntax when targets natively support it
- assert caller with supportsStaticESM: true still transpiles export * as ns unless supportsExportNamespaceFrom: true is explicitly provided
- assert caller with supportsExportNamespaceFrom: true preserves native export * as ns syntax
- assert exclude: ['transform-export-namespace-from'] disables the forced transform under modules: 'auto'
- assert targets lacking namespace export support (like Chrome 60) transpile export * as ns even with modules: false
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
- test_explore.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9