defineConfig
Define a fully typed kizlo.config.ts for the CLI's dev and test workflows.
defineConfig wraps your kizlo.config.ts so it is fully typed. The config lives at your project root (.js and
.mjs work too). kizlo init writes it for you, and you edit it as your project grows. It configures where your
Kizlo server lives and the local WordPress that kizlo dev and kizlo test provision.
Parameters
defineConfig(config)Prop
Type
dev
The local WordPress and contract watcher run by kizlo dev.
Prop
Type
test
The WordPress test environment run by kizlo test.
Prop
Type
Returns
The same config object, unchanged. defineConfig is an identity function that exists only to attach types.
Examples
Run local WordPress with dev.local and test.local (the install folder is fixed, so there's nothing else to
set). create/init write these when you choose local WordPress:
import { defineConfig } from "kizlo/config"
export default defineConfig({
dir: "src/lib/kizlo",
dev: { local: true },
test: { local: true },
})Seed both from shared fixtures, and override ports where they clash:
import { defineConfig } from "kizlo/config"
import { blogFixture } from "./fixtures/blog"
export default defineConfig({
dir: "src/lib/kizlo",
alias: "@",
dev: { local: true, fixtures: [blogFixture] },
test: { local: true, fixtures: [blogFixture] },
})