Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  20558aee_d74c_3231_0af4_9a5df8c4d247["index.ts"]
  263e522e_1aa5_ebc3_e7d6_45ebc51671f7["vite"]
  20558aee_d74c_3231_0af4_9a5df8c4d247 --> 263e522e_1aa5_ebc3_e7d6_45ebc51671f7
  style 20558aee_d74c_3231_0af4_9a5df8c4d247 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type * as vite from 'vite';

const ASTRO_APP_ID = 'virtual:astro:app';
const RESOLVED_ASTRO_APP_ID = '\0' + ASTRO_APP_ID;
export const ASTRO_DEV_SERVER_APP_ID = 'astro:server-app';

export function vitePluginApp(): vite.Plugin[] {
	let command: vite.ResolvedConfig['command'];
	return [
		{
			name: 'astro:app',
			configResolved(config) {
				command = config.command;
			},
			resolveId: {
				filter: {
					id: new RegExp(`^${ASTRO_APP_ID}$`),
				},
				handler() {
					return RESOLVED_ASTRO_APP_ID;
				},
			},
			load: {
				filter: {
					id: new RegExp(`^${RESOLVED_ASTRO_APP_ID}$`),
				},
				handler() {
					const entrypoint =
						command === 'serve' ? 'astro/app/entrypoint/dev' : 'astro/app/entrypoint/prod';

					const code = `export { createApp } from '${entrypoint}';`;

					return {
						code,
					};
				},
			},
		},
		{
			name: 'astro:server-app',
			resolveId: {
				filter: {
					id: new RegExp(`^${ASTRO_DEV_SERVER_APP_ID}$`),
				},
				handler() {
					const url = new URL('./createAstroServerApp.js', import.meta.url);
					return this.resolve(url.toString());
				},
			},
		},
	];
}

Domain

Subdomains

Functions

Dependencies

  • vite

Frequently Asked Questions

What does index.ts do?
index.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 index.ts?
index.ts defines 1 function(s): vitePluginApp.
What does index.ts depend on?
index.ts imports 1 module(s): vite.
Where is index.ts in the architecture?
index.ts is located at packages/astro/src/vite-plugin-app/index.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/vite-plugin-app).

Analyze Your Own Codebase

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

Try Supermodel Free