Skip to content

Commit

Permalink
fix: optional lang attribute, close #3
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 21, 2021
1 parent 8cbb886 commit 6d6045e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformScriptSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function transformScriptSetup(result: ParseResult) {
if (result.script.found && result.scriptSetup.found && result.scriptSetup.attrs.lang !== result.script.attrs.lang)
throw new SyntaxError('<script setup> language must be the same as <script>')

const lang = result.scriptSetup.attrs.lang || result.script.attrs.lang
const lang = result.scriptSetup.attrs.lang || result.script.attrs.lang || 'js'
const plugins: ParserPlugin[] = []
if (lang === 'ts')
plugins.push('typescript')
Expand Down

0 comments on commit 6d6045e

Please sign in to comment.