Skip to content

Commit b3269f1

Browse files
committed
use normal string literal when there are no values
1 parent 40afcc1 commit b3269f1

File tree

1 file changed

+4
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared

1 file changed

+4
-1
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ export function build_template_chunk(
157157
quasi.value.raw = sanitize_template_string(/** @type {string} */ (quasi.value.cooked));
158158
}
159159

160-
const value = b.template(quasis, expressions);
160+
const value =
161+
expressions.length > 0
162+
? b.template(quasis, expressions)
163+
: b.literal(/** @type {string} */ (quasi.value.cooked));
161164

162165
return { value, has_state };
163166
}

0 commit comments

Comments
 (0)