fix: improve codegen output

This commit is contained in:
Justineo
2023-09-04 17:16:28 +08:00
parent 705bff310f
commit 4484b4e180

View File

@ -312,13 +312,15 @@ function buildMinimalBundleCode(
importStatements.push( importStatements.push(
`import type { ComposeOption } from ${quote}echarts/core${quote}${semiStr}` `import type { ComposeOption } from ${quote}echarts/core${quote}${semiStr}`
); );
const importTypeStatements = importSources.map(([imports, mod]) => const importTypeStatements = importSources
importItems( .map(([imports, mod]) =>
imports.filter(a => a.endsWith("Option")), importItems(
mod, imports.filter(a => a.endsWith("Option")),
{ ...options, type: true } mod,
{ ...options, type: true }
)
) )
); .filter(Boolean);
importStatements.push(...importTypeStatements); importStatements.push(...importTypeStatements);
} }