Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
files.forEach(function minify(file) {
var filename = file.substring(file.lastIndexOf('/')+1);
console.log("Minifying "+file);
try { fs.mkdirSync("release"); } catch(e) {}
new compressor.minify({
type: 'gcc',
fileIn: file + '.js',
fileOut: "release/" + filename+ '-min.js'
});
});
this.files.forEach(function (file, i) {
var config = getConfig(options, file);
/**
* Callback function.
*/
config.callback = function (err) {
if (err) {
console.log(err);
done(false);
} else if (i === total - 1) {
done();
}
};
new compressor.minify(config);
});
});
return function(cb) {
options.callback = cb;
new compressor.minify(options);
};
}(options);