transform.js 256 B

12345678
  1. const { minify } = require("terser");
  2. const transform = (code, optionsString) => {
  3. const options = eval(`(${optionsString})`);
  4. return minify(code, options).then(result => ({ result, nameCache: options.nameCache }));
  5. };
  6. exports.transform = transform;