Function: defineXmVitestConfig()
API / @xmachines/shared / vitest / defineXmVitestConfig
function defineXmVitestConfig(importMetaUrl, overrides): UserConfig;Defined in: vitest.ts:76
Create a Vitest config with XMachines workspace defaults.
What this applies automatically:
resolve.aliasfromxmAliases(importMetaUrl)so@xmachines/*imports resolve to source in local/dev test runs.- In the dist run (
XM_TEST_TARGET=dist), thexmBuildOutputplugin, and an alias map with no published package in it: each@xmachines/*import then resolves through itsexportsmap todist/, and eachsrc/file that a test imports by path resolves to its counterpart indist/. config/vitest.setup.tswhen missing.config/vitest.node.setup.tsfor non-browser projects when missing.pool: "vmThreads"for jsdom projects that declare no pool.
Setup injection is additive and preserves caller-provided ordering after required shared setup files.
Parameters
| Parameter | Type | Description |
|---|---|---|
importMetaUrl | string | Pass import.meta.url from the calling config file. |
overrides | UserConfig | Package/project-specific Vitest config overrides. |
Returns
UserConfig
Merged Vitest configuration object.