Last active
December 21, 2019 16:25
-
-
Save agcty/9d500b4fd25698cde3b91583719a4392 to your computer and use it in GitHub Desktop.
Babel config
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
function isBabelLoader(caller) { | |
return caller && caller.name === "babel-loader"; | |
} | |
module.exports = function(api) { | |
if (api.env("test") && !api.caller(isBabelLoader)) { | |
return { | |
presets: [ | |
[ | |
"@babel/preset-env", | |
{ | |
targets: { | |
node: "current" | |
} | |
} | |
] | |
] | |
}; | |
} | |
return {}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment