-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Dynamic import to CommonJS does not compile to require
#1540
Comments
Dynamic import() is available since node13.2. So if you need it to be transformed to |
Even though it is supported in Node 13.2 and above, the code only runs for packages with |
Dynamic import expressions are supported in both CJS and ESM (https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_import_expressions). |
Now that's the behavior I never wanted. I'll try readjusting the node target then |
I'm going to close this because this is by design. Since
|
Yes thank you @evanw, I went with |
There seems to be a regression that happened between
0.9.5
and0.12.22
.When bundling ESM code to Node(platform: "node" and format: "cjs"), the output code seems to be unchanged.
Output:
Expected:
edit: looks like this happened on
0.10.0
whenimport
andrequire
behavior has been changed.The text was updated successfully, but these errors were encountered: