Skip to content

Instantly share code, notes, and snippets.

@agcty
Last active Dec 21, 2019
Embed
What would you like to do?
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