Saltearse al contenido

astro-integration-utils

Esta página aún no está disponible en tu idioma.

const watchConfigFile: HookUtility<"astro:config:setup", [WatchConfigFileOptions], void>;

Defined in: astro-integration-utils.ts:92^

Watches a configuration file for changes and adds it to the watch list.

This utility is defined for the ‘astro:config:setup’ hook. It locates the configuration file based on the provided root pathname and a list of possible config paths, then registers the found config file with the addWatchFile function to enable hot-reloading or rebuilds when the config changes.

An object containing:

  • addWatchFile: A function to register files to be watched.
  • config.root.pathname: The root directory pathname to search for config files.

An object containing:

  • configPaths: An array of possible configuration file paths to search for.

void

function configResolverBuilder<S>(params: ConfigResolverBuilderOpts<S>): HookUtility<"astro:config:setup", [S["_input"]], Promise<S["_output"]>>

Defined in: astro-integration-utils.ts:23^

Builds a config resolver utility for Astro integrations.

This function creates a utility that loads, validates, and merges configuration from both inline options and config files, using a provided Zod schema for validation. If both inline config and a config file are present, the config file takes precedence during merging.

S extends ZodTypeAny

ConfigResolverBuilderOpts<S>

The configuration resolver options.

HookUtility<"astro:config:setup", [S["_input"]], Promise<S["_output"]>>

A utility function to be used in the Astro config setup hook, which loads, validates, and merges configuration.