Skip to content

✨ Add dev mode theme.json generation#36

Open
retlehs wants to merge 1 commit intomainfrom
dev-theme-json-generation
Open

✨ Add dev mode theme.json generation#36
retlehs wants to merge 1 commit intomainfrom
dev-theme-json-generation

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Mar 12, 2026

Summary

  • Generate theme.json during vite dev so design token changes are immediately reflected in the WordPress block editor without a full build
  • Extract generateThemeJson() from generateBundle() so both build and dev paths share the same token extraction logic
  • On server start, call transformRequest() for the CSS entry so Tailwind tokens are available before the first browser request hits WordPress
  • Watch baseThemeJsonPath and tailwindConfig for changes, with live-reload of the Tailwind config
  • Debounced atomic writes (tmp + rename) to prevent PHP from reading half-written files
  • Unescape Vite's JS-wrapped CSS in dev mode so regex patterns can match variable declarations
  • Resolve outDir against Vite root so relative paths from laravel-vite-plugin work regardless of cwd

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant