fix(compiler-sfc): bail on import usage check when template has custom lang

fix #4312
This commit is contained in:
Evan You 2021-08-16 16:08:52 -04:00
parent a6c1db2728
commit aae3725e57

View File

@ -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)