Beispiel
Show that @babel/core 8 remains interoperable with both CommonJS require and ES module import.
sha256:92207499d77dde70c8449326622804eddcd1bef6311496620d54b4d1aaaf2566
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Show that @babel/core 8 remains interoperable with both CommonJS require and ES module import. HOW
- Pakete
- @babel/core 8.0.1
- Umgebung
- node
- Erstellt
- 2026-08-17T03:14:26Z
Häufige Annahme
Because Babel 8 presents an ES module API, `require('@babel/core')` throws `ERR_REQUIRE_ESM` and only dynamic `import()` can reach `transformSync`.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- In @babel/core 8.0.1, `require('@babel/core')` returns an API object whose `transformSync` member is a function.
- Dynamic `import('@babel/core')` also exposes `transformSync`, and both loaders reference the same function.
- The CommonJS-loaded and ESM-loaded `transformSync` calls produce identical code for the same source and options.
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9