From 5cea974451ae23b82bea0c6270ad7ac726d831a4 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Mon, 27 May 2024 00:45:26 +0800 Subject: [PATCH] fix: specify unspported pre-processors lang (#212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲智子 Kevin Deng --- src/transform.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/transform.ts b/src/transform.ts index cad23db8..052b9279 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -75,13 +75,25 @@ export async function compileFile( return errors } - if ( - descriptor.styles.some((s) => s.lang) || - (descriptor.template && descriptor.template.lang) - ) { + const styleLangs = descriptor.styles.map((s) => s.lang).filter(Boolean) + const templateLang = descriptor.template?.lang + if (styleLangs.length && templateLang) { + return [ + `lang="${styleLangs.join( + ',', + )}" pre-processors for