Skip to content

Commit

Permalink
fix(vue): retrieve rewritten code (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz authored Mar 30, 2023
1 parent 094f784 commit 199f0cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ async function genScriptCode(
const as = '_sfc_main'
if (options.compiler.rewriteDefaultAST && script.scriptAst && script.s) {
options.compiler.rewriteDefaultAST(script.scriptAst, script.s, as)
scriptCode = script.s.toString()
} else {
scriptCode = options.compiler.rewriteDefault(
script.content,
'_sfc_main',
[...defaultPlugins, ...userPlugins],
)
scriptCode = options.compiler.rewriteDefault(script.content, as, [
...defaultPlugins,
...userPlugins,
])
}
map = script.map
} else {
Expand Down

0 comments on commit 199f0cb

Please sign in to comment.