How to use the clean-css/lib/clean.process function in clean-css

To help you get started, we’ve selected a few clean-css examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fsiaonma / N-Builder / src / core / handlers / cssHandlers / cssCompression.js View on Github external
function doCleanFiles(fileIn, fileOut) {
        if (fileIn.length > 0) {
            var finalCode = [];
            var origCode = "";
            for (var i = 0, len = fileIn.length; i < len; ++i) {
                console.log("[cleaning css] cleaning " + fileIn[i]);
                origCode = fs.readFileSync(fileIn[i], 'utf8');
                var minCss = cleanCSS.process(origCode, { debug: false });
                finalCode.push(minCss);
            };

            base.createFloder(fileOut.substr(0, fileOut.lastIndexOf("/")), function() {
                fs.writeFileSync(fileOut, finalCode.join(''), 'utf8');
            });
        }
    }

clean-css

A well-tested CSS minifier

MIT
Latest version published 3 months ago

Package Health Score

91 / 100
Full package analysis