Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Last active August 29, 2015 14:19
Show Gist options
  • Save AllenFang/691acb9f74e998a1a2b0 to your computer and use it in GitHub Desktop.
Save AllenFang/691acb9f74e998a1a2b0 to your computer and use it in GitHub Desktop.
// preprocessor.js
var ReactTools = require('react-tools');
module.exports = {
process: function(src) {
return ReactTools.transform(src, {
harmony:true
});
}
};
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