-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: @modern-js/module-tools 输出 cjs 时 转换了 await import #5795
Comments
@modern-js/module-tools 底层是 esbuild,所以这本质上是 esbuild 的行为。 举个例子,如果你的目标环境不支持 如果你希望强制保留 如果有更多的问题,请提供复现链接及复现步骤帮助我们更好得排查(「请提供最小重现」)。 |
请问这里为什么要这样做呀? |
你指的是前面的还是后面的判断条件 |
cjs为什么要关闭dynamic-import? |
因为 CJS 在低版本 node 的兼容性更好,而且 Node 对 code splitting 没有什么强的诉求 |
但是这样在format为cjs时,动态导入的esm依赖就会报错,因为import被转换成了require,这个问题怎么解呢 @fi3ework |
我最开始的回复已经回答了这个问题。 |
好的,感谢耐心解答 |
版本信息
问题详情
cjs
esm
复现链接
none
复现步骤
none
The text was updated successfully, but these errors were encountered: