Skip to content

Adds a sidecar folder - a source folder that builds a process you handle yourself.

It can still listen on a port; that port is its own, not one KosmoJS routes to.

sh
pnpm sidecar mailer

It is kosmo folder's counterpart: same scaffolding, none of the web questions.

What you get

txt
src/mailer/
├── kosmo.config.ts       -> the sidecar block
├── tsconfig.json         -> extends ../../lib/mailer/tsconfig.json
└── entry.ts              -> your entry point
src/mailer/kosmo.config.ts
ts
import { defineConfig } from "@kosmojs/dev";

export default defineConfig({
  sidecar: {
    entry: "./entry.ts",
    serve: false,
  },
  typecheck: true,
});

A second worker is a second folder - one sidecar per folder keeps the build output, the dev watcher and pnpm build <name> addressable per process. Details ›

After that

pnpm build mailer builds it, pnpm typecheck mailer checks it, and pnpm dev watches it when serve is on. Starting it in preview or production is yours. Details ›

Released under the MIT License.