How to Run the Build Process for Open-SEO: Complete Guide
Run npm run build in the every-app/open-seo repository to execute Vite bundling and TypeScript type-checking, or use pnpm --dir <workspace> run build for individual workspace builds.
Open-SEO is a pnpm workspaces monorepo built with Vite and TypeScript. Understanding how to run the build process for open-seo correctly ensures you generate production-ready client assets and Cloudflare Worker bundles. This guide walks through the exact commands, configuration files, and verification steps based on the source code in every-app/open-seo.
Prerequisites: Install Dependencies
Before any build commands work, you must install workspace dependencies.
pnpm install
This command resolves the entire workspace graph defined in pnpm-workspace.yaml and installs all packages including vite, typescript, and Cloudflare plugins. The root lockfile guarantees consistent versions across all workspaces.
Run the Main Build Command
The primary way to run the build process for open-seo is through the root package.json script:
npm run build
According to the source code in package.json, this executes:
vite build && tsc --noEmit
This two-step process performs:
- Vite build – Bundles the TanStack Start client and Cloudflare Workers code using the configuration in
vite.config.ts - TypeScript check – Runs
tsc --noEmitto verify type safety without emitting files
The build output appears in two directories:
dist/– Client-side assetsworker/– Cloudflare Worker bundle
Build Individual Workspaces
For sub-projects like the badseo demo app, run the build process for open-seo workspace targets individually:
pnpm --dir badseo run build
This command respects each workspace's own Vite configuration, as documented in badseo/README.md. The root build also type-checks sub-projects via tsc --noEmit -p badseo/tsconfig.json.
Verify and Preview Your Build
After running the build process for open-seo, confirm success by checking for compiled assets. Then optionally preview locally:
npm run preview
This starts a Vite preview server on port 3001 (http://localhost:3001), letting you inspect the production build before deployment.
Deploy After Building
With a successful build, deploy to Cloudflare Workers:
npm run deploy
The deploy script invokes wrangler deploy using the configuration in wrangler.jsonc. This pushes the worker bundle along with any database migrations—build first, deploy second.
Self-Hosting Build Variant
For Docker self-hosting, the build process for open-seo uses a dedicated mode:
vite build --mode selfhost
The Dockerfile.selfhost consumes this output. Run via npm run deploy:selfhost as described in docs/SELF_HOSTING_DOCKER.md.
Key Configuration Files
| File | Purpose |
|---|---|
package.json |
Defines build, preview, and deploy scripts |
vite.config.ts |
Configures Vite with @cloudflare/vite-plugin for worker bundling |
wrangler.jsonc |
Cloudflare Workers bindings and routes |
Dockerfile.selfhost |
Packages self-hosted builds |
pnpm-workspace.yaml |
Declares workspace packages |
Summary
- Install first:
pnpm installresolves the workspace dependency graph - Main build:
npm run buildruns Vite bundling plus TypeScript checking - Workspace builds:
pnpm --dir <path> run buildfor individual packages likebadseo - Output locations:
dist/(client) andworker/(Cloudflare Worker) - Preview:
npm run previewon port 3001 for local verification - Deploy:
npm run deploypushes to Cloudflare after successful build
Frequently Asked Questions
What package manager does open-seo use?
pnpm. The repository uses pnpm workspaces with a root pnpm-workspace.yaml file and shared lockfile. All build commands assume pnpm is installed and used for dependency resolution.
Can I build without type-checking?
The default npm run build includes tsc --noEmit. To skip type-checking, run vite build directly. However, this bypasses the safety check the maintainers intended for production builds.
Where does the build output go?
Vite places client assets in dist/ and the Cloudflare Worker bundle in worker/, as configured in vite.config.ts. These paths are referenced by wrangler.jsonc during deployment.
How do I build for self-hosting instead of Cloudflare?
Use npm run deploy:selfhost or manually run vite build --mode selfhost. The Dockerfile.selfhost expects output from this build mode, which differs slightly from the standard Cloudflare-targeted build.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →