From c216c0cf0cea0c8d891fb11c767dad794edeb06a Mon Sep 17 00:00:00 2001 From: Matheus Cardoso Date: Thu, 19 Dec 2024 17:36:08 -0300 Subject: [PATCH] chore: move tmplVar inside if block --- packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts b/packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts index 245bad561a..34012923be 100644 --- a/packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts +++ b/packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts @@ -111,11 +111,11 @@ export function addGenerateMarkupFunction( // At the time of generation, the invoker does not have reference to its tag name to pass as an argument. const defaultTagName = b.literal(tagName); const classIdentifier = b.identifier(state.lwcClassName!); - const tmplVar = b.identifier('tmpl'); let exposeTemplateBlock: IfStatement | null = null; if (!tmplExplicitImports) { const defaultTmplPath = `./${pathParse(filename).name}.html`; + const tmplVar = b.identifier('tmpl'); program.body.unshift(bImportDeclaration({ default: tmplVar.name }, defaultTmplPath)); program.body.unshift( bImportDeclaration({ SYMBOL__DEFAULT_TEMPLATE: '__SYMBOL__DEFAULT_TEMPLATE' })