시작하기
설치 명령어와 이 플러그인의 전체 마크다운 가이드를 포함한 설치 프롬프트 복사
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';
const result = await LiveReload.configureServer({ url: 'https://example.com' });console.log(result);connect
연결 제목웹 소켓 연결을establish하거나 이미 활성화된 경우 활성화된 웹 소켓 연결이 있는지 확인합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
const result = await LiveReload.connect();console.log(result);disconnect
해제 제목현재 웹 소켓 연결을 종료하고 자동 재 연결을 비활성화합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
const result = await LiveReload.disconnect();console.log(result);getStatus
상태 가져오기 제목현재 연결 상태를 반환합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
const result = await LiveReload.getStatus();console.log(result);reload
재 로드 제목Capacitor WebView를 완전히 재 로드합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reload();reloadFile
reloadFile단일 파일/모듈을 재로드합니다. 런타임이 지원하는 경우 전체 재로드로 fallback합니다.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reloadFile({ path: 'path/to/file' });타입 참조
타입 참조ConfigureServerOptions
ConfigureServerOptionsexport 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
FileUpdatePayloadexport interface FileUpdatePayload { path: string; hash?: string;}LiveReloadEventCallback
LiveReloadEventCallbackexport type LiveReloadEventCallback = (event: LiveReloadEventPayload) => void;LiveReloadStatusCallback
LiveReloadStatusCallbackexport type LiveReloadStatusCallback = (status: LiveReloadStatus) => void;LiveReloadEventPayload
LiveReloadEventPayloadexport interface LiveReloadEventPayload { type: LiveReloadMessageType; /** Populated when type === 'file-update'. */ file?: FileUpdatePayload; /** Optional human-readable message for errors or status changes. */ message?: string;}LiveReloadMessageType
LiveReloadMessageTypeexport type LiveReloadMessageType = 'full-reload' | 'file-update' | 'error' | 'connected' | 'disconnected';실질적인 원천
실질적인 원천이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
다음 단계로 진행하세요
다음 단계로 진행하세요만약에 시작하기 계획 대시보드 및 API 작업을 위해 @capgo/capacitor-live-reload Using @capgo/capacitor-live-reload API 개요 API 개요 소개 소개 API 키 API 키의 구현 세부 사항에 대해 기기 __CAPGO_KEEP_0__ 키의 구현 세부 사항에 대해 기기