From: Evan You Date: Mon, 16 Aug 2021 20:08:52 +0000 (-0400) Subject: fix(compiler-sfc): bail on import usage check when template has custom lang X-Git-Tag: v3.2.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aae3725e574e0182a1b41aa3dc38b11e596570ad;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): bail on import usage check when template has custom lang fix #4312 --- diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 9e4a2ceb85..914cf28353 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)