Emit for dynamic import (import()
) when target >= ES2020 and module == None
#48702
Labels
Committed
The team has roadmapped this issue
Fix Available
A PR has been opened for this issue
Rescheduled
This issue was previously scheduled to an earlier milestone
Suggestion
An idea for TypeScript
Milestone
Bug Report
We unconditionally transform dynamic import (
import()
) regardless of the current script target when the module kind is None. This is due to us using theCommonJS
module emit as a fallback forNone
, and is causing an issue for VSCode while trying to implement support for TS Server plugins on the web via WebWorker.I propose that we change the emit behavior for
import()
when the module target isNone
to preserveimport()
. Note that this would constitute a breaking change, but I imagine the number of affected projects (those currently using both--module None
andimport()
) would be vanishingly small.🔎 Search Terms
dynamic import module none node transform emit outFile
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Transforms
import()
into a call torequire()
🙂 Expected behavior
Does not transform
import()
.The text was updated successfully, but these errors were encountered: