fix(compiler-sfc): should not remove import statements with no specifier when compiling script setup

This commit is contained in:
Evan You
2020-11-28 13:51:32 -05:00
parent a76e58e5fd
commit 43eab923ea
3 changed files with 8 additions and 2 deletions

View File

@@ -638,7 +638,7 @@ export function compileScript(
)
}
}
if (removed === node.specifiers.length) {
if (node.specifiers.length && removed === node.specifiers.length) {
s.remove(node.start! + startOffset, node.end! + startOffset)
}
}