browser
browser 用于配置开发时自动打开并加载扩展的浏览器:可执行文件路径、user-data(profile)目录,以及是否跨启动保留 profile。
概述
- 类型:
Record<BrowserName, { path?: string; profile?: string; keepBrowserProfile?: boolean }> - 默认值:
undefined(使用系统默认路径) - 是否必需:否
每个浏览器条目支持以下字段:
path— 浏览器可执行文件路径profile— 自定义 user-data(profile)目录,相对路径相对项目根解析(默认<outputRoot>/cache/browser-profile/<name>-user-data)keepBrowserProfile— 跨启动保留该浏览器的 profile,覆盖顶层keepBrowserProfile
Chromium 系浏览器
支持以下基于 Chromium 的浏览器:
配置示例
使用 CLI 启动
Firefox
Firefox 使用 web-ext 工具管理扩展,路径配置方式相同:
启动 Firefox
Info
Firefox 开发模式使用 web-ext 工具,扩展重载由 web-ext 处理而非 Addfox 的 WebSocket。
各平台示例
macOS
Windows
Linux
已废弃:browserPath
browserPath 仍可使用,但终端会打印 deprecated 警告。请迁移到 browser:
同一浏览器同时配置 browserPath 和 browser 时,browser 优先。
相关配置
- guide/launch - 浏览器启动指南
keepBrowserProfile/buildCache- 缓存配置

