@astrojs/web-vitals
이 Astro 통합을 사용하면 실제 웹사이트의 성능을 추적하고 데이터를 Astro DB에 저장할 수 있습니다. 이 데이터는 StudioCMS 대시보드에서 실제 웹사이트의 시간에 따른 성능 지표를 보여주는 데 사용됩니다.
-
다음 명령을 사용하여 패키지를 설치하고 Astro 구성에 추가합니다.
Terminal window npx astro add @astrojs/web-vitalsTerminal window pnpm astro add @astrojs/web-vitalsTerminal window yarn astro add @astrojs/web-vitals -
새 구성을 원격 데이터베이스에 푸시합니다.
Terminal window npx astro db pushTerminal window pnpm astro db pushTerminal window yarn astro db push
-
다음 명령을 사용하여 패키지를 설치합니다.
Terminal window npm i @astrojs/web-vitalsTerminal window pnpm add @astrojs/web-vitalsTerminal window yarn add @astrojs/web-vitals -
Astro 구성 파일에
@astrojs/web-vitals
를 추가합니다.astro.config.mjs importnode from '@astrojs/node';function node(userOptions: UserOptions): AstroIntegrationimportstudioCMS from 'studiocms';const studioCMS: (options?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;dbStartPage?: boolean | undefined;imageService?: {cdnPlugin?: "cloudinary-js" | undefined;} | undefined;defaultFrontEndConfig?: boolean | {htmlDefaultLanguage?: string | undefined;htmlDefaultHead?: {tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";attrs?: Record<string, string | boolean | undefined> | undefined;content?: string | undefined;}[] | undefined;favicon?: string | undefined;injectQuickActionsMenu?: boolean | undefined;} | undefined;dashboardConfig?: {dashboardEnabled?: boolean | undefined;inject404Route?: boolean | undefined;faviconURL?: string | undefined;dashboardRouteOverride?: string | undefined;AuthConfig?: {providers?: {github?: boolean | undefined;discord?: boolean | undefined;google?: boolean | undefined;auth0?: boolean | undefined;usernameAndPassword?: boolean | undefined;usernameAndPasswordConfig?: {allowUserRegistration?: boolean | undefined;} | undefined;} | undefined;enabled?: boolean | undefined;} | undefined;developerConfig?: {demoMode?: false | {password: string;username ...StudioCMS Integration
A CMS built for Astro by the Astro Community for the Astro Community.
importdb from '@astrojs/db';function db(): AstroIntegration[]importwebVitals from '@astrojs/web-vitals';function webVitals({ deprecated }?: {deprecated?: boolean;}): AstroIntegrationimport {defineConfig } from 'astro/config';function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>See the full Astro Configuration API Documentation https://astro.build/config
export defaultdefineConfig({defineConfig<never, never>(config: AstroUserConfig<never, never>): AstroUserConfig<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>.site?: stringoutput: 'server',AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.output?: "server" | "static"adapter:AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = 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>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]db(), // 필수function db(): AstroIntegration[]webVitals(),function webVitals({ deprecated }?: {deprecated?: boolean;}): AstroIntegrationstudioCMS(),function studioCMS(options?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;dbStartPage?: boolean | undefined;imageService?: {cdnPlugin?: "cloudinary-js" | undefined;} | undefined;defaultFrontEndConfig?: boolean | {htmlDefaultLanguage?: string | undefined;htmlDefaultHead?: {tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";attrs?: Record<string, string | boolean | undefined> | undefined;content?: string | undefined;}[] | undefined;favicon?: string | undefined;injectQuickActionsMenu?: boolean | undefined;} | undefined;dashboardConfig?: {dashboardEnabled?: boolean | undefined;inject404Route?: boolean | undefined;faviconURL?: string | undefined;dashboardRouteOverride?: string | undefined;AuthConfig?: {providers?: {github?: boolean | undefined;discord?: boolean | undefined;google?: boolean | undefined;auth0?: boolean | undefined;usernameAndPassword?: boolean | undefined;usernameAndPasswordConfig?: {allowUserRegistration?: boolean | undefined;} | undefined;} | undefined;enabled?: boolean | undefined;} | undefined;developerConfig?: {demoMode?: false | {password: string;username ...StudioCMS Integration
A CMS built for Astro by the Astro Community for the Astro Community.
],});Terminal window npm i @astrojs/web-vitalsTerminal window pnpm add @astrojs/web-vitalsTerminal window yarn add @astrojs/web-vitals -
새 구성을 원격 데이터베이스에 푸시합니다.
Terminal window npx astro db pushTerminal window pnpm astro db pushTerminal window yarn astro db push