2021-08-11

Copying MDX Frontmatter image to Public folder in Nextjs

selfnote, nextjs, nodejs, fs, troubleshooting

banner

Image by Jackie Matthews from Pixabay

There is no built-in mdx-bundler way to extract banner image mentioned in frontmatter.

https://github.com/kentcdodds/mdx-bundler/issues/70

Had to use fs to copy it to the public folder manualy.