Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resources.compileCSS = function compileCSS() {
var css = "";
resources.files.css.forEach(function (file) {
css += fs.readFileSync(path.join(paths.mod, file)).toString("utf8") + "\n";
});
// Vendor prefixes
css = postcss([autoprefixer]).process(css).css;
// Minify
if (minify) css = cleanCSS.minify(css).styles;
return {data: new Buffer(css), etag: etag(), mime: mime("css")};
};
Object.keys(out).forEach(function (file) {
if (/\.js$/.test(file)) {
out[file] = new Buffer(uglify.minify(out[file].toString(), opts.uglify).code);
} else if (/\.css$/.test(file)) {
out[file] = new Buffer(cleanCSS.minify(out[file].toString()).styles);
}
});
}
fs.readFile(path.join(paths.mod, "/client/cmtheme.css"), function (err, css) {
if (err) return callback(err);
themes.droppy = new Buffer(minify ? cleanCSS.minify(css).styles : css);
callback(null, themes);
});
});
filenames.forEach(function (name, index) {
var css = String(data[index]);
themes[name.replace(/\.css$/, "")] = new Buffer(minify ? cleanCSS.minify(css).styles : css);
});