File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ export const registerMDCSlotTransformer = (resolver: Resolver) => {
21
21
const codegen = context . ssr ? ( node as any ) . ssrCodegenNode : node . codegenNode
22
22
codegen . callee = codegen . callee === RENDER_SLOT ? '_renderMDCSlot' : '_ssrRenderMDCSlot'
23
23
24
- context . imports . push ( {
25
- exp : context . ssr ? '{ ssrRenderSlot as _ssrRenderMDCSlot }' : '{ renderSlot as _renderMDCSlot }' ,
26
- path : resolver . resolve ( `./runtime/utils/${ context . ssr ? 'ssrSlot' : 'slot' } ` )
27
- } )
24
+
25
+ const importExp = context . ssr ? '{ ssrRenderSlot as _ssrRenderMDCSlot }' : '{ renderSlot as _renderMDCSlot }'
26
+ if ( ! context . imports . some ( i => String ( i . exp ) === importExp ) ) {
27
+ context . imports . push ( {
28
+ exp : importExp ,
29
+ path : resolver . resolve ( `./runtime/utils/${ context . ssr ? 'ssrSlot' : 'slot' } ` )
30
+ } )
31
+ }
28
32
}
29
33
}
30
34
You can’t perform that action at this time.
0 commit comments