react-brunch
Advanced tools
+10
-11
@@ -1,8 +0,6 @@ | ||
| // Generated by CoffeeScript 1.7.1 | ||
| var ReactCompiler, transform, visitors; | ||
| // Generated by CoffeeScript 1.9.1 | ||
| var ReactCompiler, react; | ||
| visitors = require('react-tools/vendor/fbtransform/visitors'); | ||
| react = require('react-tools/main'); | ||
| transform = require('jstransform').transform; | ||
| module.exports = ReactCompiler = (function() { | ||
@@ -18,20 +16,21 @@ ReactCompiler.prototype.brunchPlugin = true; | ||
| function ReactCompiler(config) { | ||
| var _ref, _ref1, _ref2; | ||
| var ref, ref1, ref2, ref3, ref4; | ||
| this.config = config; | ||
| this.harmony = ((_ref = this.config) != null ? (_ref1 = _ref.plugins) != null ? (_ref2 = _ref1.react) != null ? _ref2.harmony : void 0 : void 0 : void 0) === true; | ||
| this.harmony = ((ref = this.config) != null ? (ref1 = ref.plugins) != null ? (ref2 = ref1.react) != null ? ref2.harmony : void 0 : void 0 : void 0) === true; | ||
| this.options = ((ref3 = this.config) != null ? (ref4 = ref3.plugins) != null ? ref4.react : void 0 : void 0) || {}; | ||
| } | ||
| ReactCompiler.prototype.compile = function(params, callback) { | ||
| var err, output, source, visitorList; | ||
| var err, output, source; | ||
| source = params.data; | ||
| visitorList = this.harmony ? visitors.getAllVisitors() : visitors.transformVisitors.react; | ||
| try { | ||
| output = transform(visitorList, source).code; | ||
| output = react.transformWithDetails(source, this.options); | ||
| } catch (_error) { | ||
| err = _error; | ||
| console.log("ERROR", err); | ||
| console.dir(output); | ||
| return callback(err.toString()); | ||
| } | ||
| return callback(null, { | ||
| data: output | ||
| data: output.code | ||
| }); | ||
@@ -38,0 +37,0 @@ }; |
+2
-3
| { | ||
| "name": "react-brunch", | ||
| "version": "1.0.7", | ||
| "version": "1.0.8", | ||
| "description": "Adds React.js support to brunch.", | ||
@@ -25,4 +25,3 @@ "author": "Matt McCray", | ||
| "dependencies": { | ||
| "react-tools": ">=0.12.1", | ||
| "jstransform": "^8.2.0" | ||
| "react-tools": "0.12.1" | ||
| }, | ||
@@ -29,0 +28,0 @@ "devDependencies": { |
+5
-2
@@ -13,4 +13,6 @@ ## react-brunch | ||
| react: | ||
| harmony: yes # include some es6 transforms | ||
| # options passed through to `react-tools.main.transformWithDetails()` | ||
| harmony: yes # include some es6 transforms | ||
| sourceMap: no # generate inline source maps | ||
| stripTypes: no # strip type annotations | ||
| # Usual brunch config stuf... | ||
@@ -35,2 +37,3 @@ files: | ||
| ## Usage | ||
@@ -37,0 +40,0 @@ Install the plugin via npm with `npm install --save react-brunch`. |
4653
2.65%1
-50%75
4.17%+ Added
- Removed
- Removed
- Removed
- Removed
Updated