Skip to content

Commit 4c9d3dd

Browse files
committed
fix(compiler-sfc): handle unref import deduplication for vapor mode
1 parent eb10d16 commit 4c9d3dd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/compiler-sfc/src/compileScript.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
BindingTypes,
3+
UNREF,
34
isFunctionType,
45
isStaticNode,
56
unwrapTSNode,
@@ -1041,7 +1042,12 @@ export function compileScript(
10411042
// avoid duplicated unref import
10421043
// as this may get injected by the render function preamble OR the
10431044
// css vars codegen
1044-
if (helpers && helpers.has('unref')) {
1045+
if (
1046+
helpers &&
1047+
(helpers.has(UNREF) ||
1048+
// vapor compiler uses 'unref' instead of UNREF
1049+
helpers.has('unref'))
1050+
) {
10451051
ctx.helperImports.delete('unref')
10461052
}
10471053
returned = code

0 commit comments

Comments
 (0)