load-plugins.ts — astro Source File
Architecture documentation for load-plugins.ts, a typescript file in the astro codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 005bacb3_f924_d887_25a0_84c0b6efe1be["load-plugins.ts"] 54ce55cc_9dc1_4ebd_28dd_358c1e22d4e7["unified"] 005bacb3_f924_d887_25a0_84c0b6efe1be --> 54ce55cc_9dc1_4ebd_28dd_358c1e22d4e7 db16cdd9_503c_ef05_b07d_daa68850434d["#import-plugin"] 005bacb3_f924_d887_25a0_84c0b6efe1be --> db16cdd9_503c_ef05_b07d_daa68850434d style 005bacb3_f924_d887_25a0_84c0b6efe1be fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type * as unified from 'unified';
import { importPlugin as _importPlugin } from '#import-plugin';
async function importPlugin(p: string | unified.Plugin<any[], any>) {
if (typeof p === 'string') {
return await _importPlugin(p);
} else {
return p;
}
}
export function loadPlugins(
items: (
| string
| [string, any]
| unified.Plugin<any[], any>
| [unified.Plugin<any[], any>, any]
)[],
): Promise<[unified.Plugin, any?]>[] {
return items.map((p) => {
return new Promise((resolve, reject) => {
if (Array.isArray(p)) {
const [plugin, opts] = p;
return importPlugin(plugin)
.then((m) => resolve([m, opts]))
.catch((e) => reject(e));
}
return importPlugin(p)
.then((m) => resolve([m]))
.catch((e) => reject(e));
});
});
}
Domain
Subdomains
Functions
Dependencies
- #import-plugin
- unified
Source
Frequently Asked Questions
What does load-plugins.ts do?
load-plugins.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in load-plugins.ts?
load-plugins.ts defines 2 function(s): importPlugin, loadPlugins.
What does load-plugins.ts depend on?
load-plugins.ts imports 2 module(s): #import-plugin, unified.
Where is load-plugins.ts in the architecture?
load-plugins.ts is located at packages/markdown/remark/src/load-plugins.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/markdown/remark/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free