Migrating Babel from CommonJS to ESM
summary
Babel migrates by changing concrete parts not slogans: tests move first, Babel adds an importInteropNode option to ignore _interop flags, and a single codebase runs both sync and async via gen-synch. Synchronous APIs that must stay synchronous use worker + Atomics to block the main thread, and Jest issues get solved with a jest lite runner. Tests go from ~5 to ~2 minutes, dual-package edge cases require many small npm patches, and a full ESM release targets Babel 8.
AI-written summary · about
chapters (9)
- 0:00Babel and ESM migration
- 5:28CommonJS to ESM challenges
- 11:27ESM in Babel's config files
- 15:40Backward compatibility in integrations
- 21:45Interoperability with native ESM
- 26:22Test runner limitations for ESM
- 28:30Babel runtime to dual packages
- 31:20Dual workflow for ESM
- 33:10Community support importance








