Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ba76ac

Browse filesBrowse files
kfuledead-claudia
authored andcommitted
Upgrade the version of Terser to make reduce_funcs work well
1 parent 1a6847f commit 4ba76ac
Copy full SHA for 4ba76ac

File tree

Expand file treeCollapse file tree

4 files changed

+152
-34
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+152
-34
lines changed

‎package-lock.json

Copy file name to clipboardExpand all lines: package-lock.json
+148-30Lines changed: 148 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"npm-run-all": "^4.1.5",
3131
"ospec": "4.2.1",
3232
"rimraf": "^6.0.1",
33-
"terser": "^4.3.4"
33+
"terser": "^5.7.2"
3434
}
3535
}

‎scripts/bundler.js

Copy file name to clipboardExpand all lines: scripts/bundler.js
+2-2Lines 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 “compress” option seems to degrade performance. So, disable it.
46-
const minified = Terser.minify(original, {compress: false, mangle: true})
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})
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")

‎scripts/minify-stream.js

Copy file name to clipboardExpand all lines: scripts/minify-stream.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function minify() {
3535
const input = path.resolve(__dirname, "../stream/stream.js")
3636
const output = path.resolve(__dirname, "../stream/stream.min.js")
3737
const original = await fs.readFile(input, "utf-8")
38-
const minified = Terser.minify(original)
38+
const minified = await Terser.minify(original)
3939
if (minified.error) throw new Error(minified.error)
4040
await fs.writeFile(output, minified.code, "utf-8")
4141
const originalSize = Buffer.byteLength(original, "utf-8")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.