Skip to content

Commit 0ddd768

Browse files
WingGaoanchengjian
authored andcommitted
[TS] 修复直接import报错
1 parent 59045bc commit 0ddd768

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mp-compiler/parse-ts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function delint (sourceFile) {
5757
switch (node.kind) {
5858
case ts.SyntaxKind.ImportDeclaration:
5959
// 只处理 import Comp from 'xxx.vue'
60-
if (node.importClause.name) {
60+
if (node.importClause && node.importClause.name) {
6161
importsMap[node.importClause.name.escapedText] = node.moduleSpecifier.text
6262
}
6363
// report(node, 'import')

0 commit comments

Comments
 (0)