diff --git a/app/lib/vite-plugin-articles.ts b/app/lib/vite-plugin-articles.ts index 86f26ff..78a5a08 100644 --- a/app/lib/vite-plugin-articles.ts +++ b/app/lib/vite-plugin-articles.ts @@ -55,6 +55,16 @@ export function articlesPlugin(): Plugin { 'app/articles.json', JSON.stringify(sortedArticles, null, 2) ) + }, + configureServer(server) { + // Watch for changes to markdown files + server.watcher.add('articles/*.md') + server.watcher.on('change', (file) => { + if (file.endsWith('.md')) { + // Trigger rebuild when markdown files change + server.restart() + } + }) } } } \ No newline at end of file