Created
October 5, 2016 01:34
-
-
Save nickpresta/b448c392fe964c1b55e056733c6b0520 to your computer and use it in GitHub Desktop.
Babel 5 Jest Preprocessor
This file contains hidden or 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 (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