From aae3725e574e0182a1b41aa3dc38b11e596570ad Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 16 Aug 2021 16:08:52 -0400 Subject: [PATCH] fix(compiler-sfc): bail on import usage check when template has custom lang fix #4312 --- packages/compiler-sfc/src/compileScript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 9e4a2ceb8..914cf2835 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -332,7 +332,7 @@ export function compileScript( } let isUsedInTemplate = true - if (isTS && sfc.template && !sfc.template.src) { + if (isTS && sfc.template && !sfc.template.src && !sfc.template.lang) { isUsedInTemplate = new RegExp( // #4274 escape $ since it's a special char in regex // (and is the only regex special char that is valid in identifiers)