|
|
@ -69,6 +69,7 @@ interface UserRouteConfig {
|
|
|
|
interface RouteModule {
|
|
|
|
interface RouteModule {
|
|
|
|
path: string
|
|
|
|
path: string
|
|
|
|
config: {
|
|
|
|
config: {
|
|
|
|
|
|
|
|
watch?: string[] | string
|
|
|
|
paths:
|
|
|
|
paths:
|
|
|
|
| UserRouteConfig[]
|
|
|
|
| UserRouteConfig[]
|
|
|
|
| ((
|
|
|
|
| ((
|
|
|
@ -76,7 +77,6 @@ interface RouteModule {
|
|
|
|
) => UserRouteConfig[] | Promise<UserRouteConfig[]>)
|
|
|
|
) => UserRouteConfig[] | Promise<UserRouteConfig[]>)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies: string[]
|
|
|
|
dependencies: string[]
|
|
|
|
watch?: string[] | string
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const routeModuleCache = new Map<string, RouteModule>()
|
|
|
|
const routeModuleCache = new Map<string, RouteModule>()
|
|
|
@ -260,8 +260,11 @@ export async function resolveDynamicRoutes(
|
|
|
|
|
|
|
|
|
|
|
|
// Process custom watch files if provided.
|
|
|
|
// Process custom watch files if provided.
|
|
|
|
let watch: string[] | undefined
|
|
|
|
let watch: string[] | undefined
|
|
|
|
if (mod.watch) {
|
|
|
|
if (mod.config.watch) {
|
|
|
|
watch = typeof mod.watch === 'string' ? [mod.watch] : mod.watch
|
|
|
|
watch =
|
|
|
|
|
|
|
|
typeof mod.config.watch === 'string'
|
|
|
|
|
|
|
|
? [mod.config.watch]
|
|
|
|
|
|
|
|
: mod.config.watch
|
|
|
|
watch = watch.map((p) =>
|
|
|
|
watch = watch.map((p) =>
|
|
|
|
p.startsWith('.')
|
|
|
|
p.startsWith('.')
|
|
|
|
? normalizePath(path.resolve(path.dirname(pathsFile), p))
|
|
|
|
? normalizePath(path.resolve(path.dirname(pathsFile), p))
|
|
|
|