File: fix-terser-use.patch

package info (click to toggle)
vue.js 2.6.14%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,272 kB
  • sloc: javascript: 57,374; sh: 97; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (2)
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)
       }