I added a static/ directory to put offline assets in like images. Then I use them like:
import { Image } from "mdx-deck"
<Image src="./static/thing.gif" />
This works with mdx-deck (dev mode), and mdx-deck pdf, but not mdx-deck build. Is there a good way to include offline static assets with builds?
My current workaround is to copy my static/ folder in npm scripts:
"build": "npm run clean && npm run static && npm run html && npm run pdf",
"clean": "rm -rf docs",
"static": "mkdir -p docs/static && cp -R src/static docs/",
"html": "mdx-deck build src/index.mdx -d docs",
"pdf": "mdx-deck pdf src/index.mdx -d docs",
Then npm run build gives me everything I need to host the presentation.
I use it like this:
<img src={require("file-loader!./somthing.png")}/>
Any plans to support ?
I use it like this:
<img src={require("file-loader!./somthing.png")}/>
I get a Uncaught ReferenceError: require is not defined using this technique to load images in dev mode.
Most helpful comment
I use it like this: