Home / File/ test-plugins.js — astro Source File

test-plugins.js — astro Source File

Architecture documentation for test-plugins.js, a javascript file in the astro codebase. 0 imports, 1 dependents.

File javascript IntegrationAdapters SsrAdapters 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  3d360664_2e29_48cd_8f31_7a5358be685d["test-plugins.js"]
  ee2aecef_0e02_3d96_17fd_685edf4aee44["content-collections.test.js"]
  ee2aecef_0e02_3d96_17fd_685edf4aee44 --> 3d360664_2e29_48cd_8f31_7a5358be685d
  style 3d360664_2e29_48cd_8f31_7a5358be685d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

export function preventNodeBuiltinDependencyPlugin() {
	// Verifies that `astro:content` does not have a hard dependency on Node builtins.
	// This is to verify it will run on Cloudflare and Deno
	return {
		name: 'verify-no-node-stuff',
		generateBundle() {
			const nodeModules = ['node:fs', 'node:url', 'node:worker_threads', 'node:path'];
			nodeModules.forEach((name) => {
				const mod = this.getModuleInfo(name);
				if (mod) {
					throw new Error(`Node builtins snuck in: ${name}`);
				}
			});
		},
	};
}

Subdomains

Frequently Asked Questions

What does test-plugins.js do?
test-plugins.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in test-plugins.js?
test-plugins.js defines 1 function(s): preventNodeBuiltinDependencyPlugin.
What files import test-plugins.js?
test-plugins.js is imported by 1 file(s): content-collections.test.js.
Where is test-plugins.js in the architecture?
test-plugins.js is located at packages/astro/test/test-plugins.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test).

Analyze Your Own Codebase

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

Try Supermodel Free