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" }] - ] - } - } -}