Skip to content

Is there any way to consume unist-util-visit from commonjs module synchronously #97

Answered by maxkoretskyi
maxkoretskyi asked this question in Q&A
Discussion options

You must be logged in to vote

If you really need to use CJS, you can use for example esbuild to build unist-util-visit and its dependencies into a CJS bundle.

thanks! is there a guide on how to do that?

However, I would like to point out that Webpack supports ESM configuration files. I recommend to use that instead if possible.

yeah, I know, but my webpack config extends cjs webpack config that I don't have access, so I can't have part cjs and part esm

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

@maxkoretskyi
Comment options

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