Skip to content

Commit 2e76ac8

Browse files
committed
disable Terser's conditionals option for performance and bundle size
Like the issue addressed in #3000, it seemed that the performance of mithril.min.js had degraded again. I tried some compression options for terser and found that disabling the `conditionals` option improved performance and also reduced the bundle size.
1 parent 8f10319 commit 2e76ac8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/bundler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ async function build() {
4242
return
4343
}
4444
console.log("minifying...")
45-
// Terser's "reduce_funcs" option seems to degrade performance. So, disable it.
46-
const minified = await Terser.minify(original, {compress: {reduce_funcs: false}, mangle: true})
45+
// Terser's "conditionals" and "reduce_funcs" options seems to degrade performance. So, disable it.
46+
const minified = await Terser.minify(original, {compress: {conditionals: false, reduce_funcs: false}, mangle: true})
4747
if (minified.error) throw new Error(minified.error)
4848
await writeFile(params.output, minified.code, "utf-8")
4949
const originalSize = Buffer.byteLength(original, "utf-8")

0 commit comments

Comments
 (0)