Function: defineXmBrowserConfig()
API / @xmachines/shared / vitest / defineXmBrowserConfig
function defineXmBrowserConfig(importMetaUrl, overrides, options?): UserConfig;Defined in: vitest.ts:167
Create a Vitest browser-mode config with XMachines workspace defaults.
Composes defineXmVitestConfig (so alias resolution, setup-file normalization/injection, and the required deep excludes all apply) and bakes in the browser boilerplate shared by every browser test project:
cacheDirfromxmCacheDir(importMetaUrl, test.name)andresolvefromxmResolve(importMetaUrl)(standalone configs only).optimizeDepsfromxmOptimizeDeps(options.optimizeDeps).test.include: ["test/browser/**/*.browser.test.ts"]andtest.exclude: ["**/node_modules/**", "**/dist/**"]defaults.test.fileParallelism: false.- Headless Playwright Chromium via
test.browser.
Everything in overrides wins over these defaults: test.include,
test.exclude, and test.setupFiles replace the defaults when provided,
and test.browser entries (e.g. an api port) are merged on top of the
Playwright defaults. Plugins stay per-package arguments (plugins: [vue()]).
Parameters
| Parameter | Type | Description |
|---|---|---|
importMetaUrl | string | Pass import.meta.url from the calling config file. |
overrides | UserConfig | Package/project-specific Vitest config overrides. overrides.test.name is required — it names the project and keys the shared Vite cache directory. |
options | XmBrowserConfigOptions | Browser-specific knobs, see XmBrowserConfigOptions. |
Returns
UserConfig
Merged Vitest configuration object.