Home / Function/ vitePluginRemovePrerenderExport() — astro Function Reference

vitePluginRemovePrerenderExport() — astro Function Reference

Architecture documentation for the vitePluginRemovePrerenderExport() function in ssr-prerender-get-static-paths.test.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  259e9128_95c0_f02f_55b3_ae73ffa23e47["vitePluginRemovePrerenderExport()"]
  1638f0e4_66a3_04b0_d45c_e8d6c9221bbb["ssr-prerender-get-static-paths.test.js"]
  259e9128_95c0_f02f_55b3_ae73ffa23e47 -->|defined in| 1638f0e4_66a3_04b0_d45c_e8d6c9221bbb
  style 259e9128_95c0_f02f_55b3_ae73ffa23e47 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/ssr-prerender-get-static-paths.test.js lines 242–258

function vitePluginRemovePrerenderExport() {
	const EXTENSIONS = ['.astro', '.ts'];
	/** @type {import('vite').Plugin} */
	const plugin = {
		name: 'remove-prerender-export',
		transform(code, id) {
			if (!EXTENSIONS.some((ext) => id.endsWith(ext))) return;
			return code.replace(/export\s+const\s+prerender\s+=\s+true;/g, '');
		},
	};
	return {
		name: 'remove-prerender-export-injector',
		configResolved(resolved) {
			resolved.plugins.unshift(plugin);
		},
	};
}

Subdomains

Frequently Asked Questions

What does vitePluginRemovePrerenderExport() do?
vitePluginRemovePrerenderExport() is a function in the astro codebase, defined in packages/astro/test/ssr-prerender-get-static-paths.test.js.
Where is vitePluginRemovePrerenderExport() defined?
vitePluginRemovePrerenderExport() is defined in packages/astro/test/ssr-prerender-get-static-paths.test.js at line 242.

Analyze Your Own Codebase

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

Try Supermodel Free