From a recent discussion on twitter: https://twitter.com/kentcdodds/status/1026817174717968386?s=20
It would be cool to be able to "import" mdx files without needing to use webpack:
API:
import React from 'react';
import {inline} from 'inline-mdx.macro';
const MDX = inline('./my-markdown-asset.md[x]');
render(
<MDX />
);
I assume we would need to wrap our current "quasis" logic here which is handling tagged template literals in a conditional to verify that the user has in fact used the tagged template string vs use inline as a function and then fs.readFileSync the file and parse it as MDX.
From a recent discussion on twitter: https://twitter.com/kentcdodds/status/1026817174717968386?s=20
It would be cool to be able to "import" mdx files without needing to use webpack:
API:
I assume we would need to wrap our current "quasis" logic here which is handling tagged template literals in a conditional to verify that the user has in fact used the tagged template string vs use
inlineas a function and thenfs.readFileSyncthe file and parse it as MDX.