Sfoglia il codice sorgente

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

fix #4312
Evan You 4 anni fa
parent
commit
aae3725e57
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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
     let isUsedInTemplate = true
-    if (isTS && sfc.template && !sfc.template.src) {
+    if (isTS && sfc.template && !sfc.template.src && !sfc.template.lang) {
       isUsedInTemplate = new RegExp(
       isUsedInTemplate = new RegExp(
         // #4274 escape $ since it's a special char in regex
         // #4274 escape $ since it's a special char in regex
         // (and is the only regex special char that is valid in identifiers)
         // (and is the only regex special char that is valid in identifiers)