Skip to content

Commit eaa323c

Browse files
committed
fix: make <script> src required
1 parent 94ec57a commit eaa323c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/compiler-sfc/src/parse.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface SFCScriptBlock extends SFCBlock {
4747
imports?: Record<string, ImportBinding>
4848
scriptAst?: import('@babel/types').Statement[]
4949
scriptSetupAst?: import('@babel/types').Statement[]
50+
src: string
5051
}
5152

5253
export interface SFCStyleBlock extends SFCBlock {
@@ -97,7 +98,7 @@ export function parse(
9798
pad = false,
9899
ignoreEmpty = true,
99100
compiler = CompilerDOM,
100-
defaultScriptLang
101+
defaultScriptLang = 'js'
101102
}: SFCParseOptions = {}
102103
): SFCParseResult {
103104
const sourceKey =
@@ -107,7 +108,7 @@ export function parse(
107108
sourceRoot +
108109
pad +
109110
compiler.parse +
110-
(defaultScriptLang != null ? '@' + defaultScriptLang : '')
111+
defaultScriptLang
111112
const cache = sourceToSFC.get(sourceKey)
112113
if (cache) {
113114
return cache

0 commit comments

Comments
 (0)