Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 6d6045e

Browse files
committed
fix: optional lang attribute, close #3
1 parent 8cbb886 commit 6d6045e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformScriptSetup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function transformScriptSetup(result: ParseResult) {
1010
if (result.script.found && result.scriptSetup.found && result.scriptSetup.attrs.lang !== result.script.attrs.lang)
1111
throw new SyntaxError('<script setup> language must be the same as <script>')
1212

13-
const lang = result.scriptSetup.attrs.lang || result.script.attrs.lang
13+
const lang = result.scriptSetup.attrs.lang || result.script.attrs.lang || 'js'
1414
const plugins: ParserPlugin[] = []
1515
if (lang === 'ts')
1616
plugins.push('typescript')

0 commit comments

Comments
 (0)