aboutsummaryrefslogtreecommitdiff
path: root/babel.config.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-01-04 00:48:34 +0900
committerPitu <[email protected]>2021-01-04 00:48:34 +0900
commitb77c0a57cc089a554ee874ae9ff5ff53e6b5eb99 (patch)
tree3f53f464b09a439958389bbd3652ebb66b33a4af /babel.config.js
parentUpdate migration (diff)
downloadhost.fuwn.me-b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99.tar.xz
host.fuwn.me-b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99.zip
feat: add testing capabilities
Diffstat (limited to 'babel.config.js')
-rw-r--r--babel.config.js21
1 files changed, 21 insertions, 0 deletions
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 {};
+};