Skip to content

Commit 6f79210

Browse files
committed
perf(legacy): set some babel options
1 parent de24b6b commit 6f79210

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/plugin-legacy/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
553553
babelrc: false,
554554
configFile: false,
555555
ast: true,
556+
code: false,
556557
sourceMaps,
557558
plugins: [
558559
// @ts-expect-error -- not typed
@@ -565,6 +566,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
565566
const babelTransformOptions: babel.TransformOptions = {
566567
babelrc: false,
567568
configFile: false,
569+
cloneInputAst: false,
568570
compact: !!config.build.minify,
569571
sourceMaps,
570572
inputSourceMap: undefined,
@@ -591,7 +593,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
591593
if (resultSystem) {
592594
result = babel.transformFromAstSync(
593595
resultSystem.ast!,
594-
resultSystem.code ?? undefined,
596+
undefined,
595597
babelTransformOptions,
596598
)
597599
} else {

0 commit comments

Comments
 (0)