Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: specify unspported pre-processors lang #212

Merged
merged 2 commits into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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