Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2014 21:41
Show Gist options
  • Save anonymous/e4d3ffcf8633bdcd19fb to your computer and use it in GitHub Desktop.
Save anonymous/e4d3ffcf8633bdcd19fb to your computer and use it in GitHub Desktop.
diff --git a/js/Gruntfile.js b/js/Gruntfile.js
index 987fcfb..f39d437 100644
--- a/js/Gruntfile.js
+++ b/js/Gruntfile.js
@@ -1,12 +1,16 @@
module.exports = function(grunt) {
+ var gruntReactBrowserify = require('grunt-react').browserify
+
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
options: {
- transform: [ require('grunt-react').browserify ]
+ transform: [function (code) {
+ return gruntReactBrowserify(code, {harmony: true});
+ }]
},
dist: {
files: {
diff --git a/js/node_modules/grunt-react/lib/transformers.js b/js/node_modules/gru
index 561cfd2..e53e806 100644
--- a/js/node_modules/grunt-react/lib/transformers.js
+++ b/js/node_modules/grunt-react/lib/transformers.js
@@ -14,7 +14,7 @@ var Transformers = {};
Transformers.source = transform;
-Transformers.browserify = function(file) {
+Transformers.browserify = function(file, options) {
var source = '';
return through(function(data) {
@@ -23,7 +23,7 @@ Transformers.browserify = function(file) {
var result;
try {
- result = Transformers.source(source);
+ result = Transformers.source(source, options);
} catch (error) {
error.message += ' in "' + file + '"';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment