From a6dab50e864814b4ef792a7928ab9f47972f85d6 Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sun, 21 Apr 2024 04:43:23 -0700 Subject: [PATCH] deps: add babel env config --- babel.config.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..d14be09d --- /dev/null +++ b/babel.config.js @@ -0,0 +1,48 @@ +const parserOpts = { + // Allow returns in the module + allowReturnOutsideFunction: true +}; + +const node = { + presets: [ + [ + '@babel/preset-env', + { + targets: { + node: true + } + } + ] + ], + plugins: [ + '@babel/plugin-transform-flow-strip-types', + [ + '@babel/plugin-proposal-decorators', + { + legacy: true + } + ] + ] +}; + +const all = { + presets: ['@babel/preset-env'], + plugins: node.plugins +}; + +const es5 = { + presets: all.presets +}; + +module.exports = (api) => { + api.cache(true); + + return { + parserOpts, + env: { + node, + all, + es5 + } + }; +};