Skip to content

Commit d1efdd0

Browse files
authored
feat: enable treeshake.commonjs by default (#313)
1 parent 5d7dc73 commit d1efdd0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/vite/src/node/build.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,15 @@ async function buildEnvironment(
636636
...options.rollupOptions.experimental,
637637
viteMode: true,
638638
},
639+
treeshake:
640+
options.rollupOptions.treeshake === false
641+
? false
642+
: {
643+
commonjs: true,
644+
...(options.rollupOptions.treeshake === true
645+
? {}
646+
: options.rollupOptions.treeshake),
647+
},
639648
}
640649

641650
/**

0 commit comments

Comments
 (0)