Is there any way to consume unist-util-visit
from commonjs module synchronously
#97
-
I'm stuck with a webpack config that is commonjs and doesn't allow async module load. I need to use unist-util-visit library. What are my options? Maybe somehow build the library locally into commonjs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
If you really need to use CJS, you can use for example esbuild to build However, I would like to point out that Webpack supports ESM configuration files. I recommend to use that instead if possible. |
Beta Was this translation helpful? Give feedback.
-
thanks! is there a guide on how to do that?
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 |
Beta Was this translation helpful? Give feedback.
thanks! is there a guide on how to do that?
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