DEV Community

ogs
ogs

Posted on

In Next.js, I want to hot-reload extensions other than `.ts, .tsx` (e.g. `.md`).

env

"next": "10.0.3",
"react": "17.0.1",
Enter fullscreen mode Exit fullscreen mode

directory structure

.
├── src
│   ├── components
│   ├── lib
│   ├── pages
│   └── posts
│       └── xxxx.md
Enter fullscreen mode Exit fullscreen mode

What I want to do

I want it to hot-reload when I changed the xxxx.md file.

I thought it could be configured in next.config.js, but I couldn't find such an item. https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config.ts#L12-L63

Top comments (1)

Collapse
 
supportic profile image
Supportic

HRM (hot refresh) for NEXT is only applied to react components. You might want to use GulpJS an listen for file changes.