Explorar el Código

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

fix #4312
Evan You hace 4 años
padre
commit
aae3725e57
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/compiler-sfc/src/compileScript.ts

+ 1 - 1
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)