Files
lnreader-plugins/scripts/terser.js
T
nyagami d36e8ec85f Feat: Vite + React (#991)
* remove test_web

* integrate reactjs-vite

* update lint-staged

* simple cors proxy server which handles cookies and redirections

* overrider global fetch with proxy call

* simple examples for set cookies and fetch request

* app bar

* add redux

* loadPlugins.
error: cant load urlencode module

* add ts-node for transforming

* plugin search & select

* plugin slice

* accordion components

* path item & popular novel

* optional for filters

* search novel

* parse novel

* parseChapter

* update cookies

* default filters

* fix: import path

* bundler module resolution

* new json_plugins

* fix: generate multisrc (missing filters)

* fix: host scripts

* fix: plugin code path

* remove typechecking action
2024-06-16 18:13:41 +07:00

22 lines
460 B
JavaScript

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