Home / File/ remarkPlugin.js — astro Source File

remarkPlugin.js — astro Source File

Architecture documentation for remarkPlugin.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
  37feb0da_5287_6603_c411_6cbdb0625dad["remarkPlugin.js"]
  7ff8d4d7_5fe1_f846_4d0b_7c925545f4b2["astro.config.mjs"]
  7ff8d4d7_5fe1_f846_4d0b_7c925545f4b2 --> 37feb0da_5287_6603_c411_6cbdb0625dad
  style 37feb0da_5287_6603_c411_6cbdb0625dad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

export default function plugin() {
	return transformer;

	function transformer(tree) {
		function traverse(node) {
			if (node.type === "image") {
				node.data = node.data || {};
				node.data.hProperties = node.data.hProperties || {};
				node.data.hProperties.loading = "eager";
				node.data.hProperties.width = "50";
			}

			if (node.children) {
				node.children.forEach(traverse);
			}
		}

		traverse(tree);
	}
}

Subdomains

Functions

Frequently Asked Questions

What does remarkPlugin.js do?
remarkPlugin.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 remarkPlugin.js?
remarkPlugin.js defines 1 function(s): plugin.
What files import remarkPlugin.js?
remarkPlugin.js is imported by 1 file(s): astro.config.mjs.
Where is remarkPlugin.js in the architecture?
remarkPlugin.js is located at packages/astro/test/fixtures/core-image-remark-imgattr/remarkPlugin.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/core-image-remark-imgattr).

Analyze Your Own Codebase

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

Try Supermodel Free