Home / Function/ flagsToAstroInlineConfig() — astro Function Reference

flagsToAstroInlineConfig() — astro Function Reference

Architecture documentation for the flagsToAstroInlineConfig() function in flags.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b35c0d90_0ee4_bd44_f397_d23b6cbd7c5b["flagsToAstroInlineConfig()"]
  8828cc9b_aa85_f4ba_73cb_ae49780007d3["flags.ts"]
  b35c0d90_0ee4_bd44_f397_d23b6cbd7c5b -->|defined in| 8828cc9b_aa85_f4ba_73cb_ae49780007d3
  style b35c0d90_0ee4_bd44_f397_d23b6cbd7c5b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/cli/flags.ts lines 10–37

export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig {
	return {
		// Inline-only configs
		configFile: typeof flags.config === 'string' ? flags.config : undefined,
		mode: typeof flags.mode === 'string' ? flags.mode : undefined,
		logLevel: flags.verbose ? 'debug' : flags.silent ? 'silent' : undefined,
		force: flags.force ? true : undefined,

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

Domain

Subdomains

Frequently Asked Questions

What does flagsToAstroInlineConfig() do?
flagsToAstroInlineConfig() is a function in the astro codebase, defined in packages/astro/src/cli/flags.ts.
Where is flagsToAstroInlineConfig() defined?
flagsToAstroInlineConfig() is defined in packages/astro/src/cli/flags.ts at line 10.

Analyze Your Own Codebase

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

Try Supermodel Free