Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

File typescript CoreAstro RoutingSystem 7 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  d6b688a6_0829_7b32_b7bf_a47697dce0f3["index.ts"]
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  515d8a27_932e_13b5_5673_5cfb92393221["plugin-vue"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> 515d8a27_932e_13b5_5673_5cfb92393221
  3cfccb60_f7d6_30e2_babc_c958321ea4b8["plugin-vue-jsx"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> 3cfccb60_f7d6_30e2_babc_c958321ea4b8
  927d4204_df6f_1efb_763b_b9373d0f0f78["compiler-sfc"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> 927d4204_df6f_1efb_763b_b9373d0f0f78
  f16d8c76_2866_6150_bd14_0347b59abfe9["astro"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> f16d8c76_2866_6150_bd14_0347b59abfe9
  263e522e_1aa5_ebc3_e7d6_45ebc51671f7["vite"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> 263e522e_1aa5_ebc3_e7d6_45ebc51671f7
  93b81c0d_1e13_d236_0050_c18dfa94381b["vite-plugin-vue-devtools"]
  d6b688a6_0829_7b32_b7bf_a47697dce0f3 --> 93b81c0d_1e13_d236_0050_c18dfa94381b
  style d6b688a6_0829_7b32_b7bf_a47697dce0f3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import path from 'node:path';
import type { Options as VueOptions } from '@vitejs/plugin-vue';
import vue from '@vitejs/plugin-vue';
import type { Options as VueJsxOptions } from '@vitejs/plugin-vue-jsx';
import { MagicString } from '@vue/compiler-sfc';
import type { AstroIntegration, AstroRenderer, HookParameters } from 'astro';
import type { EnvironmentOptions, Plugin, UserConfig } from 'vite';
import type { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';

const VIRTUAL_MODULE_ID = 'virtual:astro:vue-app';
const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;

interface Options extends VueOptions {
	jsx?: boolean | VueJsxOptions;
	appEntrypoint?: string;
	devtools?: boolean | Omit<VitePluginVueDevToolsOptions, 'appendTo'>;
}

function getRenderer(): AstroRenderer {
	return {
		name: '@astrojs/vue',
		clientEntrypoint: '@astrojs/vue/client.js',
		serverEntrypoint: '@astrojs/vue/server.js',
	};
}

function getJsxRenderer(): AstroRenderer {
	return {
		name: '@astrojs/vue (jsx)',
		clientEntrypoint: '@astrojs/vue/client.js',
		serverEntrypoint: '@astrojs/vue/server.js',
	};
}

export { getRenderer as getContainerRenderer };

function virtualAppEntrypoint(options?: Options): Plugin {
	let isBuild: boolean;
	let root: string;
	let appEntrypoint: string | undefined;

	return {
		name: VIRTUAL_MODULE_ID,
		config(_, { command }) {
			isBuild = command === 'build';
		},
		configResolved(config) {
			root = config.root;
			if (options?.appEntrypoint) {
				appEntrypoint = options.appEntrypoint.startsWith('.')
					? path.resolve(root, options.appEntrypoint)
					: options.appEntrypoint;
			}
		},
		resolveId: {
			filter: {
				id: new RegExp(`^${VIRTUAL_MODULE_ID}$`),
			},
			handler() {
				return RESOLVED_VIRTUAL_MODULE_ID;
// ... (156 more lines)

Domain

Subdomains

Types

Dependencies

  • astro
  • compiler-sfc
  • node:path
  • plugin-vue
  • plugin-vue-jsx
  • vite
  • vite-plugin-vue-devtools

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, RoutingSystem subdomain.
What functions are defined in index.ts?
index.ts defines 5 function(s): configEnvironmentPlugin, getJsxRenderer, getRenderer, getViteConfiguration, virtualAppEntrypoint.
What does index.ts depend on?
index.ts imports 7 module(s): astro, compiler-sfc, node:path, plugin-vue, plugin-vue-jsx, vite, vite-plugin-vue-devtools.
Where is index.ts in the architecture?
index.ts is located at packages/integrations/vue/src/index.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/vue/src).

Analyze Your Own Codebase

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

Try Supermodel Free