Skip to content

Commit c6b7352

Browse files
committed
perf: avoid parse repeatedly
1 parent d47eca5 commit c6b7352

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/transform.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ async function doCompileScript(
247247
inlineTemplate: true,
248248
...store.sfcOptions?.script,
249249
id,
250+
genDefaultAs: COMP_IDENTIFIER,
250251
templateOptions: {
251252
...store.sfcOptions?.template,
252253
ssr,
@@ -265,13 +266,7 @@ async function doCompileScript(
265266
2,
266267
)} */`
267268
}
268-
code +=
269-
`\n` +
270-
store.compiler.rewriteDefault(
271-
compiledScript.content,
272-
COMP_IDENTIFIER,
273-
expressionPlugins,
274-
)
269+
code += `\n${compiledScript.content}`
275270

276271
if ((descriptor.script || descriptor.scriptSetup)!.lang === 'ts') {
277272
code = await transformTS(code)

0 commit comments

Comments
 (0)