CommandKitConfig
CommandKitConfig
interface CommandKitConfig {
plugins?: MaybeArray<CommandKitPlugin>[] | Array<CommandKitPlugin>;
rolldownPlugins?: any[];
entrypoints?: string[];
compilerOptions?: CommandKitCompilerOptions;
typescript?: {
/**
* Whether to ignore type checking during builds.
*/
ignoreBuildErrors?: boolean;
};
static?: boolean;
env?: Record<string, string>;
distDir?: string;
antiCrashScript?: {
/**
* Whether to enable the anti-crash script in development mode.
* @default true
*/
development?: boolean;
/**
* Whether to enable the anti-crash script in production mode. Usually, you should use other means to handle errors.
* @default false
*/
production?: boolean;
};
sourceMap?: {
/**
* Whether to enable source map generation in development mode.
*/
development?: boolean;
/**
* Whether to enable source map generation in production mode.
*/
production?: boolean;
};
typedCommands?: boolean;
disablePrefixCommands?: boolean;
disablePermissionsMiddleware?: boolean;
showUnknownPrefixCommandsWarning?: boolean;
jsxDefaultOptionalComponents?: boolean;
experimental?: {
/**
* The runtime to use for the development server. This is an experimental feature and may be removed or changed without a major version bump. Use with caution.
* @default null
*/
devServerRuntime?: CommandKitJsRuntime | null;
/**
* Whether to emit and hydrate a pre-generated commands/events artifact in production builds.
* @default false
*/
pregenerateCommands?: boolean;
/**
* Whether to use incremental router reconciliation in development HMR.
* @default false
*/
incrementalRouter?: boolean;
};
}
plugins
MaybeArray<CommandKitPlugin>[] | Array<CommandKitPlugin>The plugins to use with CommandKit. Can be a single plugin, an array of plugins, or a nested array of plugins.
rolldownPlugins
any[]The rolldown plugins to use with CommandKit.
entrypoints
string[]The list of additional entrypoints to compile. Eg, dir or dir/index.ts or dir/*.ts, etc.
Similarly, negative patterns can be used to exclude files. Eg, !dir/index.ts or !dir/*.ts, etc.
compilerOptions
The compiler options to use with CommandKit.
typescript
{ /** * Whether to ignore type checking during builds. */ ignoreBuildErrors?: boolean; }The typescript configuration to use with CommandKit.
static
booleanWhether to generate static command handler data in production builds.
env
Record<string, string>Statically define the environment variables to use.
distDir
string`dist`The custom build directory name to use.
antiCrashScript
{ /** * Whether to enable the anti-crash script in development mode. * @default true */ development?: boolean; /** * Whether to enable the anti-crash script in production mode. Usually, you should use other means to handle errors. * @default false */ production?: boolean; }The anti-crash script configuration.
sourceMap
{ /** * Whether to enable source map generation in development mode. */ development?: boolean; /** * Whether to enable source map generation in production mode. */ production?: boolean; }Whether or not to enable the source map generation.
typedCommands
booleantrueWhether or not to enable the typed commands.
disablePrefixCommands
booleanfalseWhether or not to disable the prefix commands.
disablePermissionsMiddleware
booleanfalseWhether or not to disable the built-in permissions middleware. This only affects botPermissions and userPermissions in the command metadata.
showUnknownPrefixCommandsWarning
booleantrueWhether or not to show a warning when a prefix command is not found. This only affects development mode.
jsxDefaultOptionalComponents
booleantrueWhether to make interaction components optional by default when using JSX (opposite of Discord's default behavior).
experimental
{ /** * The runtime to use for the development server. This is an experimental feature and may be removed or changed without a major version bump. Use with caution. * @default null */ devServerRuntime?: CommandKitJsRuntime | null; /** * Whether to emit and hydrate a pre-generated commands/events artifact in production builds. * @default false */ pregenerateCommands?: boolean; /** * Whether to use incremental router reconciliation in development HMR. * @default false */ incrementalRouter?: boolean; }Experimental features configuration. These features are not stable and may be removed or changed without a major version bump. Use with caution.