fix(compiler-ssr): avoid duplicated asset imports merged from component slot client branch
fix vitejs/vite#2034
This commit is contained in:
@@ -289,14 +289,16 @@ function subTransform(
|
||||
childContext.identifiers = { ...parentContext.identifiers }
|
||||
// traverse
|
||||
traverseNode(childRoot, childContext)
|
||||
// merge helpers/components/directives/imports into parent context
|
||||
;(['helpers', 'components', 'directives', 'imports'] as const).forEach(
|
||||
key => {
|
||||
childContext[key].forEach((value: any) => {
|
||||
;(parentContext[key] as any).add(value)
|
||||
})
|
||||
}
|
||||
)
|
||||
// merge helpers/components/directives into parent context
|
||||
;(['helpers', 'components', 'directives'] as const).forEach(key => {
|
||||
childContext[key].forEach((value: any) => {
|
||||
;(parentContext[key] as any).add(value)
|
||||
})
|
||||
})
|
||||
// imports/hoists are not merged because:
|
||||
// - imports are only used for asset urls and should be consistent between
|
||||
// node/client branches
|
||||
// - hoists are not enabled for the client branch here
|
||||
}
|
||||
|
||||
function clone(v: any): any {
|
||||
|
||||
Reference in New Issue
Block a user