You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 578B

1234567891011121314151617181920
  1. var PluginError = require('plugin-error');;
  2. var through2 = require('through2');
  3. var uglifycss = require('uglifycss');
  4. module.exports = function (options) {
  5. return through2.obj(function (file, enc, cb) {
  6. if (file.isNull()) {
  7. return cb(null, file);
  8. }
  9. if (file.isStream()) {
  10. return cb(new PluginError('gulp-uglifycss', 'Stream is not supported'));
  11. }
  12. var str = file.contents.toString('utf8');
  13. file.contents = new Buffer(uglifycss.processString(str, options));
  14. return cb(null, file);
  15. });
  16. };