Skip to content

Commit b03e421

Browse files
kfuledead-claudia
authored andcommitted
disable Terser's "compress" option for performance
Terser's “compress” option seems to degrade performance. So, disable it. This commit will increase file size by about 1%, but performance appears to improve.
1 parent 664250a commit b03e421

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/bundler.js

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

0 commit comments

Comments
 (0)