From 3da33bd632acf671ac6c57e36d96a0b017236d30 Mon Sep 17 00:00:00 2001 From: Patrick Taylor Date: Sat, 8 Jun 2024 12:45:02 +0100 Subject: [PATCH] =?UTF-8?q?Convert=20babel=20config=20from=20JSON=20to=20J?= =?UTF-8?q?avaScript=20=E2=98=95=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 19 +++++++++++++++++++ babel.config.json | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 babel.config.js delete mode 100644 babel.config.json diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..6abffee --- /dev/null +++ b/babel.config.js @@ -0,0 +1,19 @@ +module.exports = { + presets: [ + ["@babel/preset-env", { targets: { node: "current" } }], + ], + env: { + cjs: { + presets: [["@babel/preset-env", { modules: "commonjs" }]], + plugins: [ + ["babel-plugin-add-import-extension", { extension: "cjs" }], + ], + }, + esm: { + presets: [["@babel/preset-env", { modules: false }]], + plugins: [ + ["babel-plugin-add-import-extension", { extension: "js" }], + ], + }, + }, +} diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index 1c726c9..0000000 --- a/babel.config.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { "targets": { "node": "current" } }] - ], - "env": { - "cjs": { - "presets": [["@babel/preset-env", { "modules": "commonjs" }]], - "plugins": [ - ["babel-plugin-add-import-extension", { "extension": "cjs" }] - ] - }, - "esm": { - "presets": [["@babel/preset-env", { "modules": false }]], - "plugins": [ - ["babel-plugin-add-import-extension", { "extension": "js" }] - ] - } - } -}