How to use the clean-css.minify 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 silverwind / droppy / server / lib / resources.js View on Github external
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")};
};
github silverwind / droppy / server / lib / resources.js View on Github external
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);
        }
      });
    }
github silverwind / droppy / server / lib / resources.js View on Github external
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);
      });
    });
github silverwind / droppy / server / lib / resources.js View on Github external
filenames.forEach(function (name, index) {
        var css = String(data[index]);
        themes[name.replace(/\.css$/, "")] = new Buffer(minify ? cleanCSS.minify(css).styles : css);
      });

clean-css

A well-tested CSS minifier

MIT
Latest version published 3 months ago

Package Health Score

91 / 100
Full package analysis