スタートガイド
インストール、同期、そしてこのプラグインのフルマークダウンガイドのセットアッププロンプトをコピーします。
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 セットアップを使用してプラグインをインストールできます。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 セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-live-reloadbunx cap syncインポート
「インポート」のセクションimport { LiveReload } from '@capgo/capacitor-live-reload';APIの概要
APIの概要configureServer
「configureServer」のセクション接続先の開発サーバーの設定を保存して、次回の接続に使用します。
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.configureServer({} as ConfigureServerOptions);connect
「connect」のセクション既存のWebSocket接続が存在しない場合、WebSocket接続を確立します。
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.connect();disconnect
「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”Trigger a full reload of the Capacitor WebView.
import { LiveReload } from '@capgo/capacitor-live-reload';
await LiveReload.reload();reloadFile
Section titled “reloadFile”サポートされている場合、ランタイムは単一のファイル/モジュールを再読み込みします (完全な再読み込みにフォールバック)。
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
「LiveReloadStatus」のセクションexport interface LiveReloadStatus { connected: boolean; url?: string;}FileUpdatePayload
「FileUpdatePayload」のセクションexport interface FileUpdatePayload { path: string; hash?: string;}LiveReloadEventCallback
「LiveReloadEventCallback」のセクションexport type LiveReloadEventCallback = (event: LiveReloadEventPayload) => void;LiveReloadStatusCallback
「LiveReloadStatusCallback」のセクションexport type LiveReloadStatusCallback = (status: LiveReloadStatus) => void;LiveReloadEventPayload
「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
「LiveReloadMessageType」のセクションexport type LiveReloadMessageType = 'full-reload' | 'file-update' | 'error' | 'connected' | 'disconnected';真実の源
「真実の源」このページはプラグインの src/definitions.tsAPIがアップストリームで変更されたときに、パブリックの再同期を実行してください。
「始めから始める」
「始めから始める」あなたが 「始めから始める」 を使用してダッシュボードとAPIの作業を計画している場合、 Using @capgo/capacitor-live-reload 「@capgo/capacitor-live-reload」 API オーバービュー API オーバービューの実装詳細について イントロダクション イントロダクションの実装詳細について API キー API キーの実装詳細について、 デバイス デバイスの実装詳細について。