Skip to content

Instantly share code, notes, and snippets.

@andrezsanchez
Created December 18, 2013 22:07
Show Gist options
  • Save andrezsanchez/8030686 to your computer and use it in GitHub Desktop.
Save andrezsanchez/8030686 to your computer and use it in GitHub Desktop.
dirty gulp jsx compile
module.exports = jsxGulp
var jsx = require('react-tools')
var es = require('event-stream')
function jsxGulp() {
function compile(file, cb) {
var err = null
try {
file.contents = new Buffer(jsx.transform(String(file.contents)))
} catch (e) {
err = e
}
cb(err, file)
}
return es.map(compile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment