Files
lnreader-plugins/scripts/terser.ts
T
Rider21 f34aced65d Updated icons (#902)
* change path

* update icon
2024-04-24 09:02:11 +07:00

23 lines
545 B
TypeScript

const { minify_sync } = require('terser');
import * as fs from 'fs';
const config = {
compress: {
arrows: false,
booleans_as_integers: true,
},
mangle: {},
ecma: 5, // specify one of: 5, 2015, 2016, etc.
enclose: false, // or specify true, or "args:values"
keep_classnames: false,
keep_fnames: false,
module: true,
toplevel: true,
};
export const minify = function (path: string) {
const code = fs.readFileSync(path).toString();
const result = minify_sync(code, config);
fs.writeFileSync(path, result.code);
};