Beispiel
Show that modern Node can synchronously require the ESM @babel/core 8 entry point.
sha256:e07a31697ad6228f9e79706f54cf68a0ea988677610b4c1dc923184e79c1fbb5
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Show that modern Node can synchronously require the ESM @babel/core 8 entry point. HOW
- Pakete
- @babel/core 8.0.1
- Umgebung
- node 22.18
- Erstellt
- 2026-08-17T03:14:47Z
Häufige Annahme
Because @babel/core 8 ships as ESM, `require('@babel/core')` must always throw ERR_REQUIRE_ESM.
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
- On Node 22.18 or newer, createRequire can synchronously load @babel/core 8 and exposes transformSync.
- CommonJS require and ESM import expose the same transformSync function.
- The required transformSync function returns generated code for a basic JavaScript input.
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