diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-05-22 19:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 19:05:18 +0200 |
commit | e191c70989a1dbf29b095bf6c2f7b62b90de012a (patch) | |
tree | 1cece207e007ce9655a90606289a9984932098ab /cli/swc_util.rs | |
parent | 4b06e357655e5e4e1aba6d9591eeb7ca269850ed (diff) |
fix: ts type imports (#5733)
Diffstat (limited to 'cli/swc_util.rs')
-rw-r--r-- | cli/swc_util.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/swc_util.rs b/cli/swc_util.rs index e07486cd7..5d900a708 100644 --- a/cli/swc_util.rs +++ b/cli/swc_util.rs @@ -307,6 +307,20 @@ impl Visit for NewDependencyVisitor { }); } + fn visit_ts_import_type( + &mut self, + ts_import_type: &swc_ecma_ast::TsImportType, + _parent: &dyn Node, + ) { + // TODO(bartlomieju): possibly add separate DependencyKind + let src_str = ts_import_type.arg.value.to_string(); + self.dependencies.push(DependencyDescriptor { + specifier: src_str, + kind: DependencyKind::Import, + span: ts_import_type.arg.span, + }); + } + fn visit_call_expr( &mut self, call_expr: &swc_ecma_ast::CallExpr, |