Skip to content

feat: allow dev server to run without building kumo first#176

Draft
danielrobertson wants to merge 1 commit intocloudflare:mainfrom
danielrobertson:drobertson/docs-dev-server-no-build
Draft

feat: allow dev server to run without building kumo first#176
danielrobertson wants to merge 1 commit intocloudflare:mainfrom
danielrobertson:drobertson/docs-dev-server-no-build

Conversation

@danielrobertson
Copy link
Contributor

Summary

  • Fix dev server startup to not require pnpm --filter @cloudflare/kumo build first
  • Add missing HMR alias for @cloudflare/kumo/code export

Problem

Running pnpm dev on a fresh clone (or after rm -rf packages/kumo/dist) failed with:

Cannot find module '@cloudflare/kumo/scripts/theme-generator/config'

This happened because vite-plugin-kumo-colors.ts imported from the package path, which resolves via package.json exports to
dist/scripts/theme-generator/config.js—a file that doesn't exist until the kumo package is built.

Additionally, after fixing that, another error appeared for @cloudflare/kumo/code which was missing from the HMR plugin's alias list.

Solution

  1. Changed vite-plugin-kumo-colors.ts to import directly from the relative source path (../../../kumo/scripts/theme-generator/config.js) instead of the
    package export. This matches the pattern already used elsewhere in the file (line 102-105 already referenced this path for file watching).
  2. Added @cloudflare/kumo/code and @cloudflare/kumo/code/server to the HMR plugin's resolve aliases.

Test plan

  • Delete packages/kumo/dist directory
  • Run pnpm install && pnpm dev
  • Verify dev server starts without errors
  • Verify docs site loads correctly at localhost:4321

@stritt
Copy link
Collaborator

stritt commented Mar 17, 2026

@danielrobertson are you still working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants