Last active
August 29, 2015 14:19
-
-
Save AllenFang/691acb9f74e998a1a2b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// preprocessor.js | |
var ReactTools = require('react-tools'); | |
module.exports = { | |
process: function(src) { | |
return ReactTools.transform(src, { | |
harmony:true | |
}); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var babel = require("babel"); | |
module.exports = { | |
process: function(src, filename) { | |
if (!babel.canCompile(filename)) { | |
return ''; | |
} | |
if (filename.indexOf('node_modules') === -1) { | |
return babel.transform(src, {filename: filename}).code; | |
} | |
return src; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment