WatchDataLoader #

VitePress-compatible form: load() receives the files watch matches, then the context.

Fields #

watchstring | string[]

Glob pattern, or a list of them, for the files to watch. Relative patterns start from the loader file.

load(watchedFiles: string[], context: DataLoaderContext): MaybePromise<T>

Produces the data from the absolute paths of the files watch matches.

optionsoptionalDataLoaderOptions

Extra options of the loader.

Full type signature
TypeScript
interface WatchDataLoader<T = unknown> {
  watch: string | string[]
  load: (watchedFiles: string[], context: DataLoaderContext) => MaybePromise<T>
  options?: DataLoaderOptions
}

Edit this page

Comments