From b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99 Mon Sep 17 00:00:00 2001 From: Pitu Date: Mon, 4 Jan 2021 00:48:34 +0900 Subject: feat: add testing capabilities --- babel.config.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 babel.config.js (limited to 'babel.config.js') diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..1aa593c --- /dev/null +++ b/babel.config.js @@ -0,0 +1,21 @@ +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 {}; +}; -- cgit v1.2.3