Skip to content

Commit 5cea974

Browse files
bteasxzz
andauthored
fix: specify unspported pre-processors lang (#212)
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
1 parent ae80c5b commit 5cea974

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/transform.ts

+18-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,25 @@ export async function compileFile(
7575
return errors
7676
}
7777

78-
if (
79-
descriptor.styles.some((s) => s.lang) ||
80-
(descriptor.template && descriptor.template.lang)
81-
) {
78+
const styleLangs = descriptor.styles.map((s) => s.lang).filter(Boolean)
79+
const templateLang = descriptor.template?.lang
80+
if (styleLangs.length && templateLang) {
81+
return [
82+
`lang="${styleLangs.join(
83+
',',
84+
)}" pre-processors for <style> and lang="${templateLang}" ` +
85+
`for <template> are currently not supported.`,
86+
]
87+
} else if (styleLangs.length) {
88+
return [
89+
`lang="${styleLangs.join(
90+
',',
91+
)}" pre-processors for <style> are currently not supported.`,
92+
]
93+
} else if (templateLang) {
8294
return [
83-
`lang="x" pre-processors for <template> or <style> are currently not ` +
84-
`supported.`,
95+
`lang="${templateLang}" pre-processors for ` +
96+
`<template> are currently not supported.`,
8597
]
8698
}
8799

0 commit comments

Comments
 (0)