Skip to content

Commit

Permalink
fix: check presence of magic-string instance when using rewriteDefaul…
Browse files Browse the repository at this point in the history
…tAST
  • Loading branch information
yyx990803 committed Mar 30, 2023
1 parent 9d84656 commit 094f784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -322,7 +322,7 @@ async function genScriptCode(
: (['typescript', 'decorators-legacy'] as const)
: []
const as = '_sfc_main'
if (options.compiler.rewriteDefaultAST && script.scriptAst) {
if (options.compiler.rewriteDefaultAST && script.scriptAst && script.s) {
options.compiler.rewriteDefaultAST(script.scriptAst, script.s, as)
} else {
scriptCode = options.compiler.rewriteDefault(
Expand Down

0 comments on commit 094f784

Please sign in to comment.