Skip to content

Commit 1671f5e

Browse files
committed
fix: specify unspported pre-processors lang
1 parent 67b0558 commit 1671f5e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/transform.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,24 @@ export async function compileFile(
6262
return errors
6363
}
6464

65-
if (
66-
descriptor.styles.some((s) => s.lang) ||
67-
(descriptor.template && descriptor.template.lang)
68-
) {
65+
const styleLang = descriptor.styles.map((s) => s.lang).filter(Boolean)
66+
const templateLang = descriptor.template?.lang
67+
if (styleLang.length && templateLang) {
68+
return [
69+
`lang="${styleLang.join(
70+
',',
71+
)}" pre-processors for <style> and lang="${templateLang}" for <template> are currently not supported.`,
72+
]
73+
}
74+
if (styleLang.length) {
75+
return [
76+
`lang="${styleLang.join(
77+
',',
78+
)}" pre-processors for <style> are currently not supported.`,
79+
]
80+
} else if (templateLang) {
6981
return [
70-
`lang="x" pre-processors for <template> or <style> are currently not ` +
71-
`supported.`,
82+
`lang="${templateLang}" pre-processors for <template> are currently not supported.`,
7283
]
7384
}
7485

0 commit comments

Comments
 (0)