let CleanCSS = require('clean-css');
(async () => {
try {
let cleanCSS = new CleanCSS({
batch: true,
returnPromise: true,
});
let outputs = await cleanCSS.minify([
{'path/to/file/one': {styles: 'html { color: #000000; }'}},
{'path/to/file/two': {styles: 'body { background: #ffffff; }'}}
]);
console.log("OK", outputs);
} catch (e) {
console.log("error", e);
}
})();