eleventy-hast-jsx
eleventy-hast-jsx copied to clipboard
Support ESM
Ideally, ESM would be supported in pages as well as component files, and the project would be rewritten to use ESM throughout.
Unfortunately, the Babel transform @babel/plugin-transform-modules-commonjs converts both static and dynamic imports to require calls (and, of course, you won’t be able to import ESM-only packages with a top-level import statement). As a result, it isn’t feasible to compile away the ESM code.
This is ~blocked on:
- Node.js adding
require.cacheandrequire.extensions-like functionality to ESM loading - https://github.com/11ty/eleventy/issues/836