Skip to content

lib/webVitals/checkForWebVitalsPlugin

const webVitalsName: "@astrojs/web-vitals" = '@astrojs/web-vitals';

Defined in: studiocms/packages/studiocms/src/lib/webVitals/checkForWebVitalsPlugin.ts:10

function checkForWebVitals(params: {
addClientDirective: (directive: ClientDirectiveConfig) => void;
addDevToolbarApp: (entrypoint: DevToolbarAppEntry) => void;
addMiddleware: (mid: AstroIntegrationMiddleware) => void;
addRenderer: (renderer: AstroRenderer) => void;
addWatchFile: (path: string | URL) => void;
command: "dev" | "build" | "preview" | "sync";
config: AstroConfig;
createCodegenDir: () => URL;
injectRoute: (injectRoute: InjectedRoute) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
isRestart: boolean;
logger: AstroIntegrationLogger;
updateConfig: (newConfig: DeepPartial<AstroConfig>) => AstroConfig;
}, ...args: [{
name: string;
verbose: boolean;
version: string;
}]):
| null
| StudioCMSPlugin

Defined in: studiocms/packages/studiocms/src/lib/webVitals/checkForWebVitalsPlugin.ts:25

Checks for the presence of the Web Vitals integration and sets up the necessary configurations.

The parameters provided by the Astro configuration setup.

(directive: ClientDirectiveConfig) => void

(entrypoint: DevToolbarAppEntry) => void

(mid: AstroIntegrationMiddleware) => void

(renderer: AstroRenderer) => void

(path: string | URL) => void

"dev" | "build" | "preview" | "sync"

AstroConfig

() => URL

(injectRoute: InjectedRoute) => void

(stage: InjectedScriptStage, content: string) => void

boolean

AstroIntegrationLogger

(newConfig: DeepPartial<AstroConfig>) => AstroConfig

…[{ name: string; verbose: boolean; version: string; }]

| null | StudioCMSPlugin

A StudioCMSPlugin object if the Web Vitals integration is enabled, otherwise null.