File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,9 @@ export function resolveTemplateCompilerOptions(
191191 return {
192192 ...options . template ,
193193 id,
194- // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
195- // @ts -ignore TODO remove ignore when dep is updated to 3.4
196- ast : descriptor . template ?. ast ,
194+ ast : canReuseAST ( options . compiler . version )
195+ ? descriptor . template ?. ast
196+ : undefined ,
197197 filename,
198198 scoped : hasScoped ,
199199 slotted : descriptor . slotted ,
@@ -213,3 +213,17 @@ export function resolveTemplateCompilerOptions(
213213 } ,
214214 }
215215}
216+
217+ /**
218+ * Versions before 3.4.3 have issues when the user has passed additional
219+ * template parse options e.g. `isCustomElement`.
220+ */
221+ function canReuseAST ( version : string | undefined ) {
222+ if ( version ) {
223+ const [ , minor , patch ] = version . split ( '.' ) . map ( Number )
224+ if ( minor >= 4 && patch >= 3 ) {
225+ return true
226+ }
227+ }
228+ return false
229+ }
You can’t perform that action at this time.
0 commit comments