hexo/node_modules/rollup-plugin-terser/transform.js

9 lines
264 B
JavaScript
Raw Permalink Normal View History

2023-10-03 11:14:36 +08:00
const { minify } = require("terser");
const transform = (code, optionsString) => {
const options = eval(`(${optionsString})`);
return minify(code, options).then(result => ({ result, nameCache: options.nameCache }));
};
exports.transform = transform;