|
|
@@ -702,7 +702,7 @@ export function compileScript(
|
|
|
const start = node.start! + scriptStartOffset!
|
|
|
const end = node.declaration.start! + scriptStartOffset!
|
|
|
s.overwrite(start, end, `const ${defaultTempVar} = `)
|
|
|
- } else if (node.type === 'ExportNamedDeclaration' && node.specifiers) {
|
|
|
+ } else if (node.type === 'ExportNamedDeclaration') {
|
|
|
const defaultSpecifier = node.specifiers.find(
|
|
|
s => s.exported.type === 'Identifier' && s.exported.name === 'default'
|
|
|
) as ExportSpecifier
|
|
|
@@ -735,6 +735,9 @@ export function compileScript(
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
+ if (node.declaration) {
|
|
|
+ walkDeclaration(node.declaration, setupBindings, userImportAlias)
|
|
|
+ }
|
|
|
} else if (
|
|
|
(node.type === 'VariableDeclaration' ||
|
|
|
node.type === 'FunctionDeclaration' ||
|