@brendonovich/kobalte__solidbase
Version:
Fully featured, fully customisable static site generation for SolidStart
23 lines • 785 B
JavaScript
import { fromJs } from "esast-util-from-js";
import { visit } from "unist-util-visit";
export function remarkRelativeImports() {
return (tree) => {
visit(tree, (node) => {
if (node.type !== "image")
return;
const { url } = node;
if (!(url.startsWith("./") || url.startsWith("../")))
return;
const ident = `$$SolidBase_RelativeImport${tree.children.length}`;
node.url = ident;
tree.children.push({
type: "mdxjsEsm",
value: "",
data: {
estree: fromJs(`import ${ident} from "${url}"`, { module: true }),
},
});
});
};
}
//# sourceMappingURL=relative-imports.js.map