Home / Function/ resolve() — astro Function Reference

resolve() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  322ea36f_8079_fb27_1ebe_e5333b36af04["resolve()"]
  d01a7ebc_4580_9594_03a5_09c288058f31["BuildUrlResolver"]
  322ea36f_8079_fb27_1ebe_e5333b36af04 -->|defined in| d01a7ebc_4580_9594_03a5_09c288058f31
  style 322ea36f_8079_fb27_1ebe_e5333b36af04 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/build-url-resolver.ts lines 27–47

	resolve(id: string): string {
		const prefix = this.#assetsPrefix
			? getAssetsPrefix(fileExtension(id), this.#assetsPrefix)
			: undefined;
		let urlPath: string;
		if (prefix) {
			this.#resources.add(prefix);
			urlPath = joinPaths(prefix, this.#base, id);
		} else {
			this.#resources.add("'self'");
			urlPath = prependForwardSlash(joinPaths(this.#base, id));
		}

		// Create URL object and append searchParams if available (for adapter-level tracking like skew protection)
		const url = createPlaceholderURL(urlPath);
		this.#searchParams.forEach((value, key) => {
			url.searchParams.set(key, value);
		});

		return stringifyPlaceholderURL(url);
	}

Domain

Subdomains

Frequently Asked Questions

What does resolve() do?
resolve() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/build-url-resolver.ts.
Where is resolve() defined?
resolve() is defined in packages/astro/src/assets/fonts/infra/build-url-resolver.ts at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free