astro-integration-utils
Esta página aún no está disponible en tu idioma.
Variables
Section titled “Variables”watchConfigFile
Section titled “watchConfigFile”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.
Returns
Section titled “Returns”void
Functions
Section titled “Functions”configResolverBuilder()
Section titled “configResolverBuilder()”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.
Type Parameters
Section titled “Type Parameters”S
extends ZodTypeAny
Parameters
Section titled “Parameters”params
Section titled “params”The configuration resolver options.
Returns
Section titled “Returns”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.