You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
409 B
JavaScript

"use strict";
const path = require("path");
module.exports = function (configPath) {
let absoluteConfigPath = path.join(__dirname, configPath);
require('@babel/register')({
only: [
(item) => item === absoluteConfigPath,
],
presets: [
require.resolve("@babel/preset-react"),
[require.resolve("@babel/preset-env"), { targets: { node: "current" } }]
]
});
return require(configPath);
}