ycp424c/dsh-browser-bridge--packages-vite-plugin0

@ycp424c/dsh-browser-bridge-vite

用于在 Vite 页面中注入 DSH 浏览器桥接器页面运行时的 Vite 插件。

AI 分析

核心用途是在前端开发流程中自动接入 DSH 桥接环境。适合使用 Vite 构建项目、并希望智能体能直接读取和操作开发中页面的开发者。

套件
@ycp424c/dsh-browser-bridge-vite
版本
0.1.0
最近更新
2026年8月14日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@ycp424c/dsh-browser-bridge-vite

Vite plugin that injects the DSH browser bridge page runtime. Dev serves inject by default; production builds inject only with the explicit bridge.injectInBuild: true switch, and the serialized config keeps the production default of zero-network dormancy. Library mode and non-HTML SSR output are never injected.

import { dshBrowserBridge } from '@ycp424c/dsh-browser-bridge-vite'

export default defineConfig({
  plugins: [dshBrowserBridge({ dshOrigin: 'http://127.0.0.1:3080' })],
})
  • dshOrigin accepts only loopback HTTP(S) origins; credentials, remote hosts, and non-HTTP(S) schemes are rejected at config time.
  • The options schema is strict: secret-shaped keys are rejected because every option ends up in the frontend bundle.
  • Serialized configs escape <, U+2028, and U+2029 so inline module scripts can never be broken out of.
  • The virtual runtime module wires the official Vite HMR events (vite:afterUpdate / dispose) in development.

See the workspace README and INSTALL.md for installation and configuration.