Skip to content

Cannot use mdast-util-from-markdown as es module export in electron, possible to get it with cjs? #108

Discussion options

You must be logged in to vote

Welcome @nikitavoloboev! 👋

Cannot use mdast-util-from-markdown as es module export in electron

See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-import-esm-in-electron
You have options:

  1. Help out with electron/electron#37535 so Electron does support ESM
  2. Bundle your dependencies with Webpack/Rollup/ESBuild into a CommonJS bundle
  3. Use the esm package.

possible to get it with cjs?

unified, mdast-util-from-markdown, and the ecosystem of packages target ES2020 and ESM (both supported by Node 16 LTS).
You are welcome to transpile/down level that into earlier versions of JavaScript, or any bespoke/legacy module format you like using build tools like webpack, r…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nikitavoloboev
Comment options

Answer selected by nikitavoloboev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants