mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
feat(48702): Emit for dynamic import (import()) when target >= ES2020 and module == None (#50942)
This commit is contained in:
@@ -850,6 +850,9 @@ export function transformModule(context: TransformationContext): (x: SourceFile
|
||||
}
|
||||
|
||||
function visitImportCallExpression(node: ImportCall): Expression {
|
||||
if (moduleKind === ModuleKind.None && languageVersion >= ScriptTarget.ES2020) {
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
const externalModuleName = getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
|
||||
const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
|
||||
// Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
|
||||
|
||||
Reference in New Issue
Block a user