/**
 * Module Dependencies
 */

var path      = require('path');
var transform = require('react-tools').transform;
var through   = require('through');

/**
 * Exports
 */

var Transformers = {};

Transformers.source = transform;

Transformers.browserify = function(file, options) {
  var source  = '';

  return through(function(data) {
    source += data;
  }, function() {
    var result;

    try {
      result = Transformers.source(source, options);
    } catch (error) {
      error.message += ' in "' + file + '"';

      this.emit('error', error);
    }

    this.queue(result);
    this.queue(null);
  });
};

module.exports = Transformers;

/**
 * Module Dependencies
 */

var path      = require('path');
var transform = require('react-tools').transform;
var through   = require('through');

/**
 * Exports
 */

var Transformers = {};

Transformers.source = transform;

Transformers.browserify = function(file, options) {
  var source  = '';

  var write = function(data) {
    source += data;
  };

  var compile = function() {
    var result;

    try {
      this.queue(Transformers.source(source, options));
    } catch (error) {
      error.message += ' in "' + file + '"';

      this.emit('error', error);
    }
  };

  return through(write, compile);
};

module.exports = Transformers;

Fix browserify transform