File tree Expand file tree Collapse file tree 4 files changed +152
-34
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +152
-34
lines changed
Original file line number Diff line number Diff line change 30
30
"npm-run-all" : " ^4.1.5" ,
31
31
"ospec" : " 4.2.1" ,
32
32
"rimraf" : " ^6.0.1" ,
33
- "terser" : " ^4.3.4 "
33
+ "terser" : " ^5.7.2 "
34
34
}
35
35
}
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ async function build() {
42
42
return
43
43
}
44
44
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 } )
47
47
if ( minified . error ) throw new Error ( minified . error )
48
48
await writeFile ( params . output , minified . code , "utf-8" )
49
49
const originalSize = Buffer . byteLength ( original , "utf-8" )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ async function minify() {
35
35
const input = path . resolve ( __dirname , "../stream/stream.js" )
36
36
const output = path . resolve ( __dirname , "../stream/stream.min.js" )
37
37
const original = await fs . readFile ( input , "utf-8" )
38
- const minified = Terser . minify ( original )
38
+ const minified = await Terser . minify ( original )
39
39
if ( minified . error ) throw new Error ( minified . error )
40
40
await fs . writeFile ( output , minified . code , "utf-8" )
41
41
const originalSize = Buffer . byteLength ( original , "utf-8" )
You can’t perform that action at this time.
0 commit comments