code: function checkFileSize(opt) {    
      var stream = through.obj(function (file, enc, cb) {
          //有大小限制
          if(opt && opt.maxSize > 0) {
              var size = file.contents.length / 1024;//转为KB
              if(size > opt.maxSize) {
                  gutil.log(gutil.colors.red('file size error:', '('+size.toFixed(2)+'KB)'+file.path));
                  this.emit("error", new PluginError('file size error', '文件大于' + opt.maxSize + 'KB '));
              }
              
          }
          this.push(file);
          cb();
      });
      return stream;
  }
docs: 限制文件大小，如果文件过大，则报错