index.js 818 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Generated by CoffeeScript 1.3.3
  2. (function() {
  3. var CleanCSSMinifier, cleanCSS, sysPath;
  4. cleanCSS = require('clean-css');
  5. sysPath = require('path');
  6. module.exports = CleanCSSMinifier = (function() {
  7. CleanCSSMinifier.prototype.brunchPlugin = true;
  8. CleanCSSMinifier.prototype.type = 'stylesheet';
  9. function CleanCSSMinifier(config) {
  10. this.config = config;
  11. null;
  12. }
  13. CleanCSSMinifier.prototype.minify = function(data, path, callback) {
  14. var error, minified;
  15. try {
  16. minified = cleanCSS.process(data);
  17. } catch (err) {
  18. error = "CSS minify failed on " + path + ": " + error;
  19. }
  20. return process.nextTick(function() {
  21. return callback(error, minified || data);
  22. });
  23. };
  24. return CleanCSSMinifier;
  25. })();
  26. }).call(this);