Skip to content

compile mdx to html with import of jsx files #2382

Answered by wooorm
AngeloChecked asked this question in Q&A
Discussion options

You must be logged in to vote

Update to v3 btw.
Plain JS files work.
Node supports loaders: so it can support importing MDX/JSX/etc files if you set it up. I’d assume Deno should have something like that.
useDynamicImport, which is the default, is needed because there is no way to eval an entire module in JavaScript. It can only eval function bodies. Only entire modules can use import statements, function bodies can use import() expressions. So we compile import statements to import expressions.
More on how it all works is explained in the docs. Or use the playground to inspect results.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wooorm
Comment options

@AngeloChecked
Comment options

@wooorm
Comment options

Answer selected by AngeloChecked
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