mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
CommonJS emit for ES6 import declarations
This commit is contained in:
1 parent
7e187ef75f
commit
69bd05946a
7 files changed
+246
-101
No files matched your search
@@ -349,21 +349,6 @@ module ts {
|
||||
});
|
||||
}
|
||||
|
||||
function getImportedModuleName(node: Node): StringLiteralExpression {
|
||||
if (node.kind === SyntaxKind.ImportDeclaration) {
|
||||
return (<ImportDeclaration>node).moduleSpecifier;
|
||||
}
|
||||
if (node.kind === SyntaxKind.ImportEqualsDeclaration) {
|
||||
var reference = (<ImportEqualsDeclaration>node).moduleReference;
|
||||
if (reference.kind === SyntaxKind.ExternalModuleReference) {
|
||||
var expr = (<ExternalModuleReference>reference).expression;
|
||||
if (expr && expr.kind === SyntaxKind.StringLiteral) {
|
||||
return <StringLiteralExpression>expr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processImportedModules(file: SourceFile, basePath: string) {
|
||||
forEach(file.statements, node => {
|
||||
if (node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) {
|
||||
|
||||
Reference in new issue
Block a user