Home / Function/ resolve() — astro Function Reference

resolve() — astro Function Reference

Architecture documentation for the resolve() function in cli-astro-config-resolver.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  12fe272b_32c6_d54d_ffe8_ef9dc2577678["resolve()"]
  9e39aa2c_4500_e5c8_b4fa_f99a707fe853["CliAstroConfigResolver"]
  12fe272b_32c6_d54d_ffe8_ef9dc2577678 -->|defined in| 9e39aa2c_4500_e5c8_b4fa_f99a707fe853
  style 12fe272b_32c6_d54d_ffe8_ef9dc2577678 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/cli/info/infra/cli-astro-config-resolver.ts lines 13–50

	async resolve(): Promise<AstroConfig> {
		const { astroConfig } = await resolveConfig(
			// TODO: consider testing flags => astro inline config
			{
				// Inline-only configs
				configFile: typeof this.#flags.config === 'string' ? this.#flags.config : undefined,
				mode: typeof this.#flags.mode === 'string' ? this.#flags.mode : undefined,
				logLevel: this.#flags.verbose ? 'debug' : this.#flags.silent ? 'silent' : undefined,
				force: this.#flags.force ? true : undefined,

				// Astro user configs
				root: typeof this.#flags.root === 'string' ? this.#flags.root : undefined,
				site: typeof this.#flags.site === 'string' ? this.#flags.site : undefined,
				base: typeof this.#flags.base === 'string' ? this.#flags.base : undefined,
				outDir: typeof this.#flags.outDir === 'string' ? this.#flags.outDir : undefined,
				server: {
					port: typeof this.#flags.port === 'number' ? this.#flags.port : undefined,
					host:
						typeof this.#flags.host === 'string' || typeof this.#flags.host === 'boolean'
							? this.#flags.host
							: undefined,
					open:
						typeof this.#flags.open === 'string' || typeof this.#flags.open === 'boolean'
							? this.#flags.open
							: undefined,
					allowedHosts:
						typeof this.#flags.allowedHosts === 'string'
							? this.#flags.allowedHosts.split(',')
							: typeof this.#flags.allowedHosts === 'boolean' && this.#flags.allowedHosts === true
								? this.#flags.allowedHosts
								: [],
				},
			},
			'info',
		);

		return astroConfig;
	}

Domain

Subdomains

Frequently Asked Questions

What does resolve() do?
resolve() is a function in the astro codebase, defined in packages/astro/src/cli/info/infra/cli-astro-config-resolver.ts.
Where is resolve() defined?
resolve() is defined in packages/astro/src/cli/info/infra/cli-astro-config-resolver.ts at line 13.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free