fix(compiler-ssr): avoid duplicated asset imports merged from component slot client branch

fix vitejs/vite#2034
This commit is contained in:
Evan You
2021-02-15 12:12:45 -05:00
parent a238da1082
commit c69f4ea857
4 changed files with 19 additions and 19 deletions

View File

@@ -89,7 +89,7 @@ export interface TransformContext
components: Set<string>
directives: Set<string>
hoists: (JSChildNode | null)[]
imports: Set<ImportItem>
imports: ImportItem[]
temps: number
cached: number
identifiers: { [name: string]: number | undefined }
@@ -163,7 +163,7 @@ export function createTransformContext(
components: new Set(),
directives: new Set(),
hoists: [],
imports: new Set(),
imports: [],
constantCache: new Map(),
temps: 0,
cached: 0,
@@ -293,7 +293,7 @@ export function transform(root: RootNode, options: TransformOptions) {
root.helpers = [...context.helpers]
root.components = [...context.components]
root.directives = [...context.directives]
root.imports = [...context.imports]
root.imports = context.imports
root.hoists = context.hoists
root.temps = context.temps
root.cached = context.cached