Files
react/bin/jsx
Ben Newman 658f41cb30 Simplify bin/jsx to perform just the JSX transform.
We will continue using `bin/jsx-internal`, well, internally.

Note that this version no longer respects `@providesModule`, and it
doesn't do anything special with constants like `__DEV__`, so we can no
longer get to claim that `bin/jsx` can be used to build the core.

I'm happy about this, personally, because it demonstrates the flexibility
of Commoner.
2013-09-06 16:20:25 -04:00

13 lines
377 B
JavaScript
Executable File

#!/usr/bin/env node
"use strict";
var visitors = require('../vendor/fbtransform/visitors').transformVisitors;
var transform = require('jstransform').transform;
require("commoner").resolve(function(id) {
return this.readModuleP(id);
}).process(function(id, source) {
// This is where JSX, ES6, etc. desugaring happens.
return transform(visitors.react, source).code;
});