@react-gnome/core
Version:
## Getting Started
21 lines (20 loc) • 739 B
JavaScript
// src/config/eval-js-config/eval-js-config.esm.ts
import path from "path";
var evalJsConfigFile = async (config) => {
const ext = path.extname(config);
if (ext === ".cjs" || ext === ".cts") {
throw new Error(
`Invalid config file: react-gtk CLI is running in ESM mode and can only accept configs in ESModule format. To run react-gtk in CommonJS mode, set the 'type' field in your package.json to 'commonjs'.`
);
}
const defaultExport = await import(config);
if (typeof defaultExport.default === "function") {
return defaultExport.default;
}
throw new Error(
`The default export of the config file must be a function, but it was a ${typeof defaultExport.default}`
);
};
export {
evalJsConfigFile
};