Home / Function/ compileWithBase() — astro Function Reference

compileWithBase() — astro Function Reference

Architecture documentation for the compileWithBase() function in css-base-path.test.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  5a4645fc_4b56_d153_ce36_97975c630539["compileWithBase()"]
  b8da955d_64be_d008_9e2a_3221c1af60ee["css-base-path.test.js"]
  5a4645fc_4b56_d153_ce36_97975c630539 -->|defined in| b8da955d_64be_d008_9e2a_3221c1af60ee
  style 5a4645fc_4b56_d153_ce36_97975c630539 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/units/compile/css-base-path.test.js lines 12–41

async function compileWithBase(source, base = '/') {
	const viteConfig = await resolveConfig({ configFile: false }, 'serve');
	const result = await compileAstro({
		compileProps: {
			astroConfig: {
				root: pathToFileURL('/'),
				base,
				experimental: {},
				build: {
					format: 'directory',
				},
				trailingSlash: 'ignore',
			},
			viteConfig,
			preferences: {
				get: () => Promise.resolve(false),
			},
			filename: '/src/pages/index.astro',
			source,
		},
		astroFileToCompileMetadata: new Map(),
		logger: {
			info: () => {},
			warn: () => {},
			error: () => {},
			debug: () => {},
		},
	});
	return result;
}

Subdomains

Frequently Asked Questions

What does compileWithBase() do?
compileWithBase() is a function in the astro codebase, defined in packages/astro/test/units/compile/css-base-path.test.js.
Where is compileWithBase() defined?
compileWithBase() is defined in packages/astro/test/units/compile/css-base-path.test.js at line 12.

Analyze Your Own Codebase

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

Try Supermodel Free