Skip to content

Instantly share code, notes, and snippets.

@agcty
Last active December 21, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agcty/9d500b4fd25698cde3b91583719a4392 to your computer and use it in GitHub Desktop.
Save agcty/9d500b4fd25698cde3b91583719a4392 to your computer and use it in GitHub Desktop.
Babel config
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