1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Description: fir terser use
Author: Yadd <yadd@debian.org>
Bug-Debian: https://bugs.debian.org/1026108
Forwarded: not-needed
Last-Update: 2022-12-15
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -48,7 +48,7 @@
.then(bundle => bundle.generate(output))
.then(({ output: [{ code }] }) => {
if (isProd) {
- const minified = (banner ? banner + '\n' : '') + terser.minify(code, {
+ terser.minify(code, {
toplevel: true,
output: {
ascii_only: true
@@ -56,8 +56,10 @@
compress: {
pure_funcs: ['makeMap']
}
- }).code
- return write(file, minified, true)
+ })
+ .then(minified => {
+ return write(file, minified.code, true)
+ })
} else {
return write(file, code)
}
|