(input)
| 3 | import { minify } from "terser"; |
| 4 | |
| 5 | const min = async (input) => { |
| 6 | return ( |
| 7 | await minify(input, { |
| 8 | compress: { |
| 9 | drop_console: false, |
| 10 | dead_code: true, |
| 11 | reduce_vars: true, |
| 12 | }, |
| 13 | output: { |
| 14 | beautify: false, |
| 15 | comments: false, |
| 16 | }, |
| 17 | mangle: true, |
| 18 | }) |
| 19 | ).code |
| 20 | .split("\\n") |
| 21 | .map((e) => { |
| 22 | return e.trimStart(); |
| 23 | }) |
| 24 | .join("\\n"); |
| 25 | }; |
| 26 | |
| 27 | console.time("build"); |
| 28 |