Home / File/ utils.ts — astro Source File

utils.ts — astro Source File

Architecture documentation for utils.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 3 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  03aa5eba_ea2a_299c_af28_0d2e00408727["utils.ts"]
  b22cc567_7c94_b043_647c_f856a5f6d8aa["../core/build/common.js"]
  03aa5eba_ea2a_299c_af28_0d2e00408727 --> b22cc567_7c94_b043_647c_f856a5f6d8aa
  e9b74c5a_8d34_34a7_e196_5e41b87214aa["../types/astro.js"]
  03aa5eba_ea2a_299c_af28_0d2e00408727 --> e9b74c5a_8d34_34a7_e196_5e41b87214aa
  c32d12e2_d85e_28c0_eea7_9b29629857e0["../types/public/config.js"]
  03aa5eba_ea2a_299c_af28_0d2e00408727 --> c32d12e2_d85e_28c0_eea7_9b29629857e0
  style 03aa5eba_ea2a_299c_af28_0d2e00408727 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { getOutDirWithinCwd } from '../core/build/common.js';
import type { AstroSettings } from '../types/astro.js';
import type { AstroConfig } from '../types/public/config.js';

export function getPrerenderDefault(config: AstroConfig) {
	return config.output !== 'server';
}

/**
 * Returns the correct output directory of the SSR build based on the configuration
 */
export function getServerOutputDirectory(settings: AstroSettings): URL {
	return settings.buildOutput === 'server'
		? settings.config.build.server
		: getOutDirWithinCwd(settings.config.outDir);
}

/**
 * Returns the correct output directory of the client build based on the configuration
 */
export function getClientOutputDirectory(settings: AstroSettings): URL {
	return settings.buildOutput === 'server' ? settings.config.build.client : settings.config.outDir;
}

Domain

Subdomains

Dependencies

  • ../core/build/common.js
  • ../types/astro.js
  • ../types/public/config.js

Frequently Asked Questions

What does utils.ts do?
utils.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in utils.ts?
utils.ts defines 3 function(s): getClientOutputDirectory, getPrerenderDefault, getServerOutputDirectory.
What does utils.ts depend on?
utils.ts imports 3 module(s): ../core/build/common.js, ../types/astro.js, ../types/public/config.js.
Where is utils.ts in the architecture?
utils.ts is located at packages/astro/src/prerender/utils.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/prerender).

Analyze Your Own Codebase

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

Try Supermodel Free