Getting Started
설치 단계와 이 플러그인에 대한 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-live-reload`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/live-reload/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
bun add @capgo/capacitor-live-reloadbunx cap syncimport
설정 제목 “import”import { LiveReload } from '@capgo/capacitor-live-reload';API 개요
설정 제목 “API 개요”configureServer
configureServer다음 연결에 사용할远程 개발 서버 설정을 저장합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.configureServer({} as ConfigureServerOptions);connect
connectWebSocket 연결을establish합니다. (이미 연결된 경우 제외)
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.connect();disconnect
disconnect현재 WebSocket 연결을 종료하고 자동 재 연결을 비활성화합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.disconnect();getStatus
getStatus현재 연결 상태를 반환합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.getStatus();reload
__CAPGO_KEEP_0__ 다시 로드Capacitor 다시 로드를 트리거합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reload();reloadFile
__CAPGO_KEEP_0__ 다시 로드 파일__CAPGO_KEEP_0__ 다시 로드 파일을 reload합니다. (런타임이 지원하는 경우 단일 파일/모듈을 reload합니다. 다른 경우 전체 다시 로드).
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reloadFile({} as FileUpdatePayload);타입 참조
타입 참조ConfigureServerOptions
서버 옵션 구성export interface ConfigureServerOptions { /** * Base URL for the dev server (e.g. https://dev.local:5173). * When a connection is established the Capacitor WebView navigates to this URL. */ url: string; /** Optional WebSocket path override when different from /ws. */ websocketPath?: string; /** Extra headers sent when creating the WebSocket connection. */ headers?: Record<string, string>; /** Automatically reconnect when the socket closes unexpectedly. Default: true. */ autoReconnect?: boolean; /** Delay (ms) between reconnection attempts. Default: 2000. */ reconnectInterval?: number;}LiveReloadStatus
실시간 다시 로드 상태export interface LiveReloadStatus { connected: boolean; url?: string;}FileUpdatePayload
파일 업데이트 페이로드export interface FileUpdatePayload { path: string; hash?: string;}LiveReloadEventCallback
라이브 리로드 이벤트 콜백export type LiveReloadEventCallback = (event: LiveReloadEventPayload) => void;LiveReloadStatusCallback
라이브 리로드 상태 콜백export type LiveReloadStatusCallback = (status: LiveReloadStatus) => void;LiveReloadEventPayload
라이브 리로드 이벤트 페이로드export interface LiveReloadEventPayload { type: LiveReloadMessageType; /** Populated when type === 'file-update'. */ file?: FileUpdatePayload; /** Optional human-readable message for errors or status changes. */ message?: string;}LiveReloadMessageType
라이브 리로드 메시지 타입export type LiveReloadMessageType = 'full-reload' | 'file-update' | 'error' | 'connected' | 'disconnected';진실의 근원
진실의 근원이 페이지는 플러그인의 src/definitions.ts. upstream의 공공 API이 변경될 때 다시 동기화 하십시오.
Getting Started에서 계속
Getting Started에서 계속하는 섹션Capacitor를 사용하고 계신다면 Getting Started 대시보드 및 API 운영을 계획하고 싶다면, 그것을 Using @capgo/capacitor-live-reload Using @capgo/capacitor-live-reload API Overview API Overview 소개 __CAPGO_KEEP_0__ API 키 API 키의 구현 세부 사항, 및 장치 __CAPGO_KEEP_0__ 키의 구현 세부 사항.