시작하기
복사할 수 있는 설치 지시문과 이 플러그인의 전체 마크다운 가이드를 포함합니다.
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.
설치
설치 제목AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음 명령어를 사용하여 다음 프롬프트를 입력하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-live-reload` plugin in my project.Manual Setup을 사용하는 경우, 플러그인을 설치하려면 다음 명령어를 실행하고 아래 플랫폼별 지침을 따르세요:
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
연결이미 활성화된 WebSocket 연결이 없으면 WebSocket 연결을establish합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.connect();disconnect
연결현재 WebSocket 연결을 종료하고 자동 재 연결을 비활성화합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.disconnect();getStatus
Section titled “getStatus”현재 연결 상태를 반환합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.getStatus();reload
Section titled “reload”Capacitor WebView를 완전하게 다시 로드합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reload();reloadFile
Section titled “reloadFile”런타임이 지원하는 경우 단일 파일/모듈을 다시 로드하고 그렇지 않으면 완전한 다시 로드에 fallback합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reloadFile({} as FileUpdatePayload);Type Reference
Section titled “Type Reference”ConfigureServerOptions
Section titled “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
LiveReloadStatusexport interface LiveReloadStatus { connected: boolean; url?: string;}FileUpdatePayload
파일 업데이트 페이로드export interface FileUpdatePayload { path: string; hash?: string;}LiveReloadEventCallback
LiveReload 이벤트 콜백export type LiveReloadEventCallback = (event: LiveReloadEventPayload) => void;LiveReloadStatusCallback
LiveReload 상태 콜백export type LiveReloadStatusCallback = (status: LiveReloadStatus) => void;LiveReloadEventPayload
LiveReload 이벤트 페이로드export interface LiveReloadEventPayload { type: LiveReloadMessageType; /** Populated when type === 'file-update'. */ file?: FileUpdatePayload; /** Optional human-readable message for errors or status changes. */ message?: string;}LiveReloadMessageType
LiveReload 메시지 타입export type LiveReloadMessageType = 'full-reload' | 'file-update' | 'error' | 'connected' | 'disconnected';실질적인 진실
“실질적인 진실” 섹션이 페이지는 플러그인의 src/definitions.ts__.CAPGO_KEEP_0__이 업스트림에서 변경될 때마다 pubic API을 다시 동기화하세요.
Getting Started에서 계속
“Getting Started에서 계속” 섹션이 플러그인을 사용하는 경우 Getting Started 계획 대시보드 및 API 운영을 위해 Getting Started을 연결하세요. capgo/capacitor-live-reload capgo/capacitor-live-reload을 사용하여 @capgo/capacitor-live-reload API 개요 API 구현 세부 사항에 대한 정보 소개 소개 구현 세부 사항에 대한 정보 API 키 API 키 구현 세부 사항에 대한 정보, 그리고 장치 장치 구현 세부 사항에 대한 정보