eleventy-hast-jsx icon indicating copy to clipboard operation
eleventy-hast-jsx copied to clipboard

Support ESM

Open j-f1 opened this issue 3 years ago • 0 comments

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.cache and require.extensions-like functionality to ESM loading
  • https://github.com/11ty/eleventy/issues/836

j-f1 avatar Feb 22 '22 17:02 j-f1