Skip to content

Instantly share code, notes, and snippets.

@nickpresta
Created October 5, 2016 01:34
Show Gist options
  • Save nickpresta/b448c392fe964c1b55e056733c6b0520 to your computer and use it in GitHub Desktop.
Save nickpresta/b448c392fe964c1b55e056733c6b0520 to your computer and use it in GitHub Desktop.
Babel 5 Jest Preprocessor
var babel = require('babel');
module.exports = {
process: function(src, filename) {
if (filename.indexOf('node_modules') === -1 && babel.canCompile(filename)) {
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