Skip to content

Commit

Permalink
fix: specify unspported pre-processors lang (#212)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
  • Loading branch information
btea and sxzz committed May 26, 2024
1 parent ae80c5b commit 5cea974
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <style> and lang="${templateLang}" ` +
`for <template> are currently not supported.`,
]
} else if (styleLangs.length) {
return [
`lang="${styleLangs.join(
',',
)}" pre-processors for <style> are currently not supported.`,
]
} else if (templateLang) {
return [
`lang="x" pre-processors for <template> or <style> are currently not ` +
`supported.`,
`lang="${templateLang}" pre-processors for ` +
`<template> are currently not supported.`,
]
}

Expand Down

0 comments on commit 5cea974

Please sign in to comment.