The dev block
The dev block controls the local development watcher that restarts your bot process when source files change. All fields are optional. The default entrypoint is src/main.ts and the default debounce is 300 milliseconds; most projects only need to adjust debounce to prevent restart storms during rapid saves.
import { defineConfig } from '@spraxium/core';
export default defineConfig({
dev: {
entrypoint: 'src/main.ts',
debounce: 500,
include: ['locales'],
exclude: ['.spraxium/**', 'dist/**'],
},
});| Field | Type | Default | Purpose |
|---|---|---|---|
| entrypoint | string | src/main.ts | File executed by the watcher when restarting the process. |
| include | string[] | [] | Additional directories to trigger restarts on change. |
| exclude | string[] | [] | Glob patterns to ignore during file watching. |
| debounce | number | 300 | Milliseconds to wait after a change before triggering a restart. |
Exclude generated directories
Always add .spraxium/** and dist/** to the exclude list. These directories change during build operations, and watching them causes infinite restart loops that destabilize the watcher process.
Supported config filenames
The framework searches for your config file using the following priority order. In production mode, compiled output is checked first; in all other modes the TypeScript source takes precedence.
| Priority | Path | Mode |
|---|---|---|
| 1 | .spraxium/dist/spraxium.config.js | Production only |
| 2 | dist/spraxium.config.js | Production only |
| 3 | spraxium.config.ts | All modes |
| 4 | spraxium.config.js | All modes |
| 5 | spraxium.config.mjs | All modes |
Environment resolution
NODE_ENV is read once during startup and mapped to a ConfigEnv object. This value never changes after the config has been loaded, so all environment-based branching must happen inside your defineConfig callback.
| NODE_ENV | Mode | Active flags |
|---|---|---|
| production | production | isProd = true |
| neutral, staging, test | neutral | isNeutral = true |
| Any other value | development | isDev = true |