How seedcord runs your bot
Run and build your bot through Vite, so the same Vite plugins, .env files, and data files work in seedcord dev, codegen, and the production build.
Your bot's source can't run as it is. Your handlers use decorators, which node's own TypeScript support stops on with a parser error. Compiling with tsc gets past the decorators. It still leaves a handler unable to import a .yaml file, and your translation files never reach dist unless you copy them there yourself.
seedcord solves all three by loading your bot through Vite (opens in a new tab). Vite compiles the decorators, and a Vite plugin can turn the .yaml file into code. The translation folder goes into dist once you list it under files.
Every seedcord command loads your bot this way. seedcord dev runs it. seedcord codegen and seedcord commands import it. seedcord build builds it. All of them use the same Vite plugins. A plugin you add for dev also runs in the build unless its apply option limits it, so an import that works while you edit works in production too.
What you get
- Any Vite plugin. A plugin you list in
seedcord.config.tsruns on your bot's code in every command, so a handler can import a.yamlfile. Vite plugins shows how. .envfiles per environment.ENV=staging pnpm buildloads.env.stagingafter.env, so its values win. Environment and config has the order and how to read the values.- Data files. List a folder like
./localesunderfilesandreadFilesreads it the same way in dev and in a built bot. Data files covers it. - Where it runs. The same build gives you a Node or Bun server, a Cloudflare Worker, a package other projects install, or a bot inside your own server.
seedcord.config.tsand acloudflare.config.tsbeside it decide which.
Installing Vite
vite is a peer dependency of seedcord. A bot from pnpm create seedcord already has it. pnpm, npm, and Bun install peer dependencies on their own, but Yarn leaves them out, so on Yarn you add it yourself:
pnpm add -D viteYour bot and the CLI need the same copy of Vite. With two versions installed, TypeScript rejects your Vite plugins' types.