Skip to content

Commit 094f784

Browse files
committed
fix: check presence of magic-string instance when using rewriteDefaultAST
1 parent 9d84656 commit 094f784

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/plugin-vue/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async function genScriptCode(
322322
: (['typescript', 'decorators-legacy'] as const)
323323
: []
324324
const as = '_sfc_main'
325-
if (options.compiler.rewriteDefaultAST && script.scriptAst) {
325+
if (options.compiler.rewriteDefaultAST && script.scriptAst && script.s) {
326326
options.compiler.rewriteDefaultAST(script.scriptAst, script.s, as)
327327
} else {
328328
scriptCode = options.compiler.rewriteDefault(

0 commit comments

Comments
 (0)