We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca139d8 commit 9d84656Copy full SHA for 9d84656
packages/plugin-vue/src/main.ts
@@ -321,11 +321,16 @@ async function genScriptCode(
321
? (['typescript'] as const)
322
: (['typescript', 'decorators-legacy'] as const)
323
: []
324
- scriptCode = options.compiler.rewriteDefault(
325
- script.content,
326
- '_sfc_main',
327
- [...defaultPlugins, ...userPlugins],
328
- )
+ const as = '_sfc_main'
+ if (options.compiler.rewriteDefaultAST && script.scriptAst) {
+ options.compiler.rewriteDefaultAST(script.scriptAst, script.s, as)
+ } else {
+ scriptCode = options.compiler.rewriteDefault(
329
+ script.content,
330
+ '_sfc_main',
331
+ [...defaultPlugins, ...userPlugins],
332
+ )
333
+ }
334
map = script.map
335
} else {
336
if (script.src) {
0 commit comments