Replies: 5 comments 4 replies
-
I found a solution but it's not the best IMO: // index.mdx
<img src={require("./background.jpg")} /> |
Beta Was this translation helpful? Give feedback.
-
@kud hey, any luck finding a better solution? I'm struggling with exactly the same problem |
Beta Was this translation helpful? Give feedback.
-
I ended up using https://github.com/sergioramos/remark-copy-linked-files and it works well 👍 next.config.js
cc @dpyzo0o |
Beta Was this translation helpful? Give feedback.
-
Any standard and officially supported way for this? |
Beta Was this translation helpful? Give feedback.
-
Any update on this? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use next.js + mdx and I wonder how to inject images from the same folder that my
.mdx
which are inpages
folders?I've tried different ways and only import with jsx way works.
As you can see on the screenshot, I've got two places for those images:
I tried different ways:
All public images work, obviously.
But about the same folder, only
<img src={testSrc} />
this one work.The different ways work thanks to
const images = require("remark-images")
(especially this behaviour where you inject directly the path of the image like/images/background.jpg
)So my question is how to make next.js or/and webpack + mdx to make this work:
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions