From 01b8db688d60a45ce7b61664807f113153e7d6c6 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 23 Feb 2025 02:10:29 +0530 Subject: [PATCH] fix --- src/node/plugins/dynamicRoutesPlugin.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node/plugins/dynamicRoutesPlugin.ts b/src/node/plugins/dynamicRoutesPlugin.ts index 125f3937..d94f9556 100644 --- a/src/node/plugins/dynamicRoutesPlugin.ts +++ b/src/node/plugins/dynamicRoutesPlugin.ts @@ -69,6 +69,7 @@ interface UserRouteConfig { interface RouteModule { path: string config: { + watch?: string[] | string paths: | UserRouteConfig[] | (( @@ -76,7 +77,6 @@ interface RouteModule { ) => UserRouteConfig[] | Promise) } dependencies: string[] - watch?: string[] | string } const routeModuleCache = new Map() @@ -260,8 +260,11 @@ export async function resolveDynamicRoutes( // Process custom watch files if provided. let watch: string[] | undefined - if (mod.watch) { - watch = typeof mod.watch === 'string' ? [mod.watch] : mod.watch + if (mod.config.watch) { + watch = + typeof mod.config.watch === 'string' + ? [mod.config.watch] + : mod.config.watch watch = watch.map((p) => p.startsWith('.') ? normalizePath(path.resolve(path.dirname(pathsFile), p))