@astrojs/web-vitals
Einführung
Abschnitt betitelt „Einführung“Diese Astro-Integration ermöglicht die Verfolgung der realen Website-Leistung und die Speicherung der Daten in der Astro-DB. Diese Daten werden im StudioCMS-Dashboard verwendet, um die Leistungsmetriken deiner Website aus der realen Welt im Laufe der Zeit anzuzeigen.
Installation
Abschnitt betitelt „Installation“-
Installiere das Paket und füge es mit dem folgenden Befehl zu deiner Astro-Konfiguration hinzu:
Terminal-Fenster npx astro add @astrojs/web-vitalsTerminal-Fenster pnpm astro add @astrojs/web-vitalsTerminal-Fenster yarn astro add @astrojs/web-vitals -
Übertrage die neue Konfiguration auf deine Ferndatenbank:
Terminal-Fenster npx astro db pushTerminal-Fenster pnpm astro db pushTerminal-Fenster yarn astro db push
-
Installiere das Paket mit dem folgenden Befehl:
Terminal-Fenster npm i @astrojs/web-vitalsTerminal-Fenster pnpm add @astrojs/web-vitalsTerminal-Fenster yarn add @astrojs/web-vitals -
Füge
@astrojs/web-vitalszu deiner Astro-Konfigurationsdatei hinzu:astro.config.mjs importnode from '@astrojs/node';function node(userOptions: UserOptions): AstroIntegrationimportstudioCMS from 'studiocms';const studioCMS: () => AstroIntegrationStudioCMS Integration
StudioCMS is an open-source headless CMS built for Astro, by members of the Astro community.
To configure StudioCMS, create a
studiocms.config.*file in the root of your Astro project. Then, import thedefineStudioCMSConfigfunction fromstudiocms/configand export the configuration as the default export.Note: Supported config file extensions are
.ts,.js,.mts, and.mjs.importdb from '@astrojs/db';function db(options?: AstroDBConfig): AstroIntegration[]importwebVitals from '@astrojs/web-vitals';import webVitalsError ts(2307) ―import {defineConfig } from 'astro/config';function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never, const TFontFamilies extends FontFamily[] = never>(config: AstroUserConfig<TLocales, TDriver, TFontFamilies>): AstroUserConfig<TLocales, TDriver, TFontFamilies>See the full Astro Configuration API Documentation https://astro.build/config
export defaultdefineConfig({defineConfig<never, never, never>(config: AstroUserConfig<never, never, never>): AstroUserConfig<never, never, never>See the full Astro Configuration API Documentation https://astro.build/config
site: 'https://demo.studiocms.dev/',AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.site?: stringoutput: 'server',AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.output?: "server" | "static"adapter:AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.adapter?: AstroIntegrationnode({function node(userOptions: UserOptions): AstroIntegrationmode: "standalone" }),UserOptions.mode: "standalone" | "middleware"Specifies the mode that the adapter builds to.
- 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
- 'standalone' - Build to a standalone server. The server starts up just by running the built script.
integrations: [AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]db(), // ERFORDERLICHfunction db(options?: AstroDBConfig): AstroIntegration[]webVitals(),import webVitalsstudioCMS(),function studioCMS(): AstroIntegrationStudioCMS Integration
StudioCMS is an open-source headless CMS built for Astro, by members of the Astro community.
To configure StudioCMS, create a
studiocms.config.*file in the root of your Astro project. Then, import thedefineStudioCMSConfigfunction fromstudiocms/configand export the configuration as the default export.Note: Supported config file extensions are
.ts,.js,.mts, and.mjs.],});Terminal-Fenster npm i @astrojs/web-vitalsTerminal-Fenster pnpm add @astrojs/web-vitalsTerminal-Fenster yarn add @astrojs/web-vitals -
Übertrage die neue Konfiguration auf deine remote Datenbank:
Terminal-Fenster npx astro db pushTerminal-Fenster pnpm astro db pushTerminal-Fenster yarn astro db push