import { visit } from "unist-util-visit"; import { select } from "hast-util-select"; export default function insertJSX(componentName, data = {}) { return async (tree) => { const fn = await import(`./input/templates/${componentName}.jsx`); //FIX avoid strict filestruct past "input" tree.children.unshift(fn.default(data)); }; }